-5

Possible Duplicate:
Timezone conversion

I want to write a java code for converting date formats from one timezone to another with daylight. I am using Oracle Database. Any Thoughts?

Community
  • 1
  • 1
user1915636
  • 139
  • 1
  • 3
  • 16

1 Answers1

0

You would like to do this

Date date = new Date();  

DateFormat formatter = new SimpleDateFormat("dd MMM yyyy HH:mm:ss z");  
formatter.setTimeZone(TimeZone.getTimeZone("CET"));  

// Prints the date in the CET timezone  
System.out.println(formatter.format(date));  

// Set the formatter to use a different timezone  
formatter.setTimeZone(TimeZone.getTimeZone("IST"));  

// Prints the date in the IST timezone  
System.out.println(formatter.format(date));  
Jayamohan
  • 12,734
  • 2
  • 27
  • 41