Duplicate :
|
FULL PRODUCT VERSION : java version "1.4.2_13" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_13-b06) Java HotSpot(TM) Client VM (build 1.4.2_13-b06, mixed mode) ADDITIONAL OS VERSION INFORMATION : Microsoft Windows [Version 6.0.6000] (Windows Vista 32-bit) A DESCRIPTION OF THE PROBLEM : user.timezone System property report wrong time zone. My time zone is GMT+8, but System.getProperty("user.timezone") reports the time zone is GMT. ACTUAL - System.getProperty("user.timezone") always report wrong result. REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- import java.util.*; public class TZ { public static void main(String[] args) { System.out.println ("timezone1:" + System.getProperty("user.timezone")); TimeZone tz = TimeZone.getDefault(); System.out.println( "tz:" + tz); //Get timezone again. the time zone is GMT, but my timezone is actually GMT+8. System.out.println ("timezone2:" + System.getProperty("user.timezone")); } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : JDK1.6 has no such problem. But we have to use JDK1.4.2.