This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Timezones Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Timezones" Watch "Timezones" New topic
Author

Timezones

Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
Hi,
I am not understanding why second part of code is not displaying the time according to respective timezones.
Following code works correctly.That is, it shows the corresponding time in that timezone.

but this doesn't

Above code displays only Local machine time!


MH
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
Maybe you should post the code where you're creating the timezone that gets passed into printTimeZone as a parameter.
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
TimeZone reference has been passed correctly as prior to that I am printing all available TimeZones.
Problem seems to be that DateFormat is must while printing local time of any TimeZone.
Is it possible to get local time of any timezone without using DateFormat?
 
wood burning stoves
 
subject: Timezones