aspose file tools*
The moose likes Java in General and the fly likes TimeZone Date convertion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "TimeZone Date convertion" Watch "TimeZone Date convertion" New topic
Author

TimeZone Date convertion

Joao Cunha
Greenhorn

Joined: Jul 12, 2004
Posts: 24
Hi folks!

I want to convert a Date from an specific TimeZone to GMT-00:00 timezone
I already tried to set a Calendar with the date and set the Time Zone but it didn't work...

Any idea?
Thanks!
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
How did it not work? How about giving some code that shows ...


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Joao Cunha
Greenhorn

Joined: Jul 12, 2004
Posts: 24
Initially I have a time on an specif TimeZone:

> Calendar c = Calendar.getInstance();
> c.setTime(date);
> System.out.println(c.getTime());

I want to have this time on GMT-00:00 time zone.
I tried this, but it didn't work:

>c.setTimeZone(TimeZone.getTimeZone("GMT-00:00"));
>System.out.println(c.getTime());
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: TimeZone Date convertion
 
Similar Threads
how to get user defined timezone using XMLGregorianCalendar.
Time Zone Conversion of a String
setting Timezone for web application
Working with dates, timezones, zulu
calendar to date and timezone