Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

TimeZone Conversion  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!