On one computer in our development shop, java's notion of time is one hour behind. It seems that Java gets the wrong default timezone for that machine, and I can't for the life of me figure out why.
All machines are running java 1.4.2_03 on WinXP SP1 with all latest updates as of 5/25/04. In the Windows Date/Time control panel on all machines, timezone is set to "(GMT-0:800) Pacific Time (US & Canada); Tijuana" and the "Automatically Adjust for Daylight Savings Time" box is checked. It is May May 26, so daylight savings time is in effect. The Windows clock in the lower right corner reads the same time on all machines.
Running the code:
TimeZone tz = TimeZone.getDefault();
System.out.println("the default timezone is " + tz.getDisplayName(true, TimeZone.LONG));
System.out.println("the default timezone ID is " + tz.getID());
System.out.println("useDaylightTime = " + tz.useDaylightTime());
On the "bad" machine produces:
the default timezone is GMT-08:00
the default timezone ID is GMT-08:00
useDaylightTime = false
All other machines produce
the default timezone is Pacific Daylight Time
the default timezone ID is America/Los_Angeles
useDaylightTime = true
Why is the timezone on the "bad" machine "GMT-08:00" instead of "America/LosAngeles"?
(I've also verified that the default Locale on all machines is the same).
Any help would be appreciated.