aspose file tools*
The moose likes Java in General and the fly likes Updating Time Zone when Windows Changes Time Zones Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Updating Time Zone when Windows Changes Time Zones" Watch "Updating Time Zone when Windows Changes Time Zones" New topic
Author

Updating Time Zone when Windows Changes Time Zones

Jimmy Ho
Ranch Hand

Joined: Jul 31, 2007
Posts: 61

I've noticed that if I go onto my Windows machine and change the time zone, the time zone returned by my Java application (which has been running this whole time) returns the prior time zone. I have to restart the Java application for the change to take effect.

Is there any way to have the JRE/Java re-load the time zone information from the Windows operating system without having to restart my JRE?

FYI, I'm on JDK 1.5_17, and the servers I run it on use mostly Windows 2000, though I've noticed this happens on Windows XP as well.

Thanks,
Jimmy
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

No.

(It's more efficient for the JVM to just get the time zone when it starts up. The probability that the time zone will change while the application is running is so tiny, it's not worth the cost of getting it every single time the default time zone is required. You weren't planning on making a habit of changing your machine's time zone, were you?)
 
 
subject: Updating Time Zone when Windows Changes Time Zones