From: Bjoern-Arne Meyn <###@###.###>
On my computer running under Windows 95, the default timezone is MET (Middle European Time = GMT + 1 / +2 DST). Java code such as the following should return MET as default timzone and a raw offset of 1 (* 60 * 60 * 1000).
SimpleTimeZone stz = (SimpleTimeZone)SimpleTimeZone .getDefault();
System.out.println(stz.getID());
System.out.println(stz.getRawOffset() / (60 * 60 * 1000));
The values returned by the code are GMT and 0, no matter what the actual timezone is. If I change the timezone in my system's configuration, to EST for example, Java fails to notice this and still returns the values above.
On my computer running under Windows 95, the default timezone is MET (Middle European Time = GMT + 1 / +2 DST). Java code such as the following should return MET as default timzone and a raw offset of 1 (* 60 * 60 * 1000).
SimpleTimeZone stz = (SimpleTimeZone)SimpleTimeZone .getDefault();
System.out.println(stz.getID());
System.out.println(stz.getRawOffset() / (60 * 60 * 1000));
The values returned by the code are GMT and 0, no matter what the actual timezone is. If I change the timezone in my system's configuration, to EST for example, Java fails to notice this and still returns the values above.
- duplicates
-
JDK-4069784 TimeZone.getDefault() returns incorrect time zome.
-
- Closed
-
- relates to
-
JDK-4031021 Calendar.getTime() does not return localized date and time. It always returns GM
-
- Closed
-