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?
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?
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));