This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Java in General and the fly likes TimeZone Conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "TimeZone Conversion" Watch "TimeZone Conversion" New topic

TimeZone Conversion

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I would like to change from one timeone to GMT and vice versa. ANybody has any idea about this. When I use the offset for that timezone from GMT and the String to initialize the timezone and then parse the date, it still shows up as the local JVM timezone.
Can anyone throw some light on this?
Denise Hum

Joined: Oct 09, 2001
Posts: 20
Try using java.text.DateFormat and java.util.TimeZone. You can set the time zone in the DateFormat object and it will display the time in that zone.
It is sorta covered in the JavaRanch Style Guide.
subject: TimeZone Conversion
jQuery in Action, 3rd edition