JDK-6609349 : (tz) [Vista] user.timezone System property report wrong time zone.
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2007-09-26
  • Updated: 2010-07-29
  • Resolved: 2007-10-05
Related Reports
Duplicate :  
Description
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.