JDK-4762673 : user.timezone is GMT when it should be Australia/Sydney
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2002-10-14
  • Updated: 2003-08-06
  • Resolved: 2003-08-06
Related Reports
Duplicate :  
Description

Name: gm110360			Date: 10/14/2002


FULL PRODUCT VERSION :
C:\>java -version
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)


FULL OPERATING SYSTEM VERSION :

Microsoft Windows 2000 [Version 5.00.2195]
Service Pack 3

EXTRA RELEVANT SYSTEM CONFIGURATION :
Dump system properties ...
----------------------------------------------------
acl.read = +
acl.read.default =
acl.write = +
acl.write.default =
application.home = C:\J2SDK1~1.1\jre
awt.toolkit = sun.awt.windows.WToolkit
browser = sun.plugin
browser.vendor = Sun Microsystems, Inc.
browser.version = 1.1
file.encoding = Cp1252
file.encoding.pkg = sun.io
file.separator = file.separator.applet = true
http.agent = Mozilla/4.0 (Windows 2000 5.0)
https.protocols = SSLv3,SSLv2Hello
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.awt.printerjob = sun.awt.windows.WPrinterJob
java.class.path = C:\J2SDK1~1.1\jre\classes
java.class.version = 48.0
java.class.version.applet = true
java.endorsed.dirs = C:\J2SDK1~1.1\jre\lib\endorsed
java.ext.dirs = C:\J2SDK1~1.1\jre\lib\ext
java.home = C:\J2SDK1~1.1\jre
java.io.tmpdir = C:\TEMPjava.library.path = C:\Program Files\Internet
Explorer;.;C:\WINNT\System32;C:\WINNT;C:\Program
Files\Proximity\Thunderserver\bin;C:\Program
Files\Proximity\Xenomotion\bin;C:\WINNT\system32;C:\WINNT;C:
\WINNT\System32\Wbem;C:\profile
java.protocol.handler.pkgs = sun.plugin.net.protocol
java.runtime.name = Java(TM) 2 Runtime Environment,
Standard Edition
java.runtime.version = 1.4.1-b21
java.specification.name = Java Platform API Specification
java.specification.vendor = Sun Microsystems Inc.
java.specification.version = 1.4
java.util.prefs.PreferencesFactory =
java.util.prefs.WindowsPreferencesFactory
java.vendor = Sun Microsystems Inc.
java.vendor.applet = true
java.vendor.url = http://java.sun.com/
java.vendor.url.applet = true
java.vendor.url.bug = http://java.sun.com/cgi-
bin/bugreport.cgi
java.version = 1.4.1
java.version.applet = true
java.vm.info = mixed mode
java.vm.name = Java HotSpot(TM) Client VM
java.vm.specification.name = Java Virtual Machine
Specification
java.vm.specification.vendor = Sun Microsystems Inc.
java.vm.specification.version = 1.0
java.vm.vendor = Sun Microsystems Inc.
java.vm.version = 1.4.1-b21
javaplugin.cache.size = 20m
javaplugin.console = hide
javaplugin.exception = false
javaplugin.jre.path = C:\j2sdk1.4.1
javaplugin.jre.type = JDK
javaplugin.jre.version = 1.4.1
javaplugin.maxHeapSize = 96m
javaplugin.nodotversion = 141
javaplugin.proxy.config.type = auto
javaplugin.proxy.usebrowsersettings = true
javaplugin.version = 1.4.1
javaplugin.vm.options = -Djava.class.path=C:\J2SDK1~1.1
\jre\classes -Xbootclasspath/a:C:\PROGRA~1\Java\J2RE14~1.1
\lib\jaws.jar;C:\J2SDK1~1.1\jre\..\lib\tools.jar -Xmx96m -
Djavaplugin.maxHeapSize=96m -Xverify:remote -
Djavaplugin.version=1.4.1 -Djavaplugin.nodotversion=141 -
Dbrowser=sun.plugin -DtrustProxy=true -
Dapplication.home=C:\J2SDK1~1.1\jre -
Djava.protocol.handler.pkgs=sun.plugin.net.protocol
line.separator = \r\n
line.separator.applet = true
os.arch = x86
os.arch.applet = true
os.name = Windows 2000
os.name.applet = true
os.version = 5.0
os.version.applet = true
package.restrict.access.netscape = false
package.restrict.access.sun = true
package.restrict.definition.java = true
package.restrict.definition.netscape = true
package.restrict.definition.sun = true
path.separator = ;
path.separator.applet = true
sun.arch.data.model = 32
sun.boot.class.path = C:\J2SDK1~1.1
\jre\lib\rt.jar;C:\J2SDK1~1.1\jre\lib\i18n.jar;C:\J2SDK1~1.1
\jre\lib\sunrsasign.jar;C:\J2SDK1~1.1
\jre\lib\jsse.jar;C:\J2SDK1~1.1
\jre\lib\jce.jar;C:\J2SDK1~1.1
\jre\lib\charsets.jar;C:\J2SDK1~1.1\jre\classes;C:\PROGRA~1
\Java\J2RE14~1.1\lib\jaws.jar;C:\J2SDK1~1.1
\jre\..\lib\tools.jar
sun.boot.library.path = C:\J2SDK1~1.1\jre\bin
sun.cpu.endian = little
sun.cpu.isalist = pentium i486 i386
sun.io.unicode.encoding = UnicodeLittle
sun.java2d.fontpath =
sun.net.client.defaultConnectTimeout = 120000
sun.os.patch.level = Service Pack 3
trustProxy = true
user.country = AU
user.dir = C:\Documents and Settings\Administrator\Desktop
user.home = C:\Documents and Settings\Administrator
user.language = en
user.name = Administrator
user.timezone = GMT
user.variant =
----------------------------------------------------
Done.


A DESCRIPTION OF THE PROBLEM :
The Java Plugin uses GMT timezone, even though Windows has
been configured correctly for Australia/Sydney. The Java
Plugin uses the following:

user.timezone = GMT

Windows Date/Time Properties is set to "(GMT+10:00)
Canberra, Melbourne, Sydney" and "Automatically adjust for
daylight savings" is turned on.

The default Windows system locale is configured as "English
(Australia)"


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Set Windows Date/Time Properties is to "(GMT+10:00)
Canberra, Melbourne, Sydney" and turn on "Automatically
adjust for daylight savings" option.

2. Set the default Windows system locale to "English
(Australia)"

3. Set the input locale to "English (Australia)" and remove
any other locales.

4. Start Java Plugin using any applet loaded into Internet
Explorer 5.5

Display system properties and observe that user.timezone is
incorrectly set to GMT.



2.
3.

EXPECTED VERSUS ACTUAL BEHAVIOR :
user.timezone should be Australia/Sydney but is GMT instead.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error messages, however any code that displays time is off by 10 hours.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
No code required to reproduce.

---------- END SOURCE ----------

CUSTOMER WORKAROUND :
None found.
(Review ID: 165732) 
======================================================================

Comments
EVALUATION Java Plug-in doesn't set the time zone property, re-assigning to classes_util_i18n for further evaluation ###@###.### 2002-10-16 This is not reproducible. The only difference in the test environment from the bug report is that I used IE 6.0. But it's very unlikely that the symptom depends on IE versions. Could the bug submitter provide the list of system properties *before* running any applet? The user.timezone property should be null "" and it's set the first time TimeZone.getDefault() is called. ###@###.### 2002-10-17 The symptom was reproducible right after installing SP3 on Windows 2000 server. However, the symptom was never reproducible after switching to another time zone and back to Sydney. Rebooting the system didn't help for repro. This (switching to another time zone and back) might be another workaround. ###@###.### 2002-11-20 When the symptom is reproducible, Win32 API function GetTimeZoneInformation() returns inconsistent values with its corresponding registry values. This happens in a time zone for which a Service Pack updates its information. There's one byte (actually DWORD) change for the Sydney time zone between SP2 and SP3. That change fixes the standard time transition bug of Windows. See Microsoft Knowledge Base Article 304303 for details. GetTimeZoneInformation() seems to return the values in the TimeZoneInformation registry which hasn't been updated by the Service Pack installation. This explains the reason why the workaround operation (switching to another and back) fixes this problem. So it's recommended to perform the workaround operation after installing SP3. Otherwise, your system may not support the correct daylight saving time transitions. I'm closing this bug report. ###@###.### 2002-11-22 The reason why 1.3 can detect Australia/Sydney is that 1.3 checks less parameters in the current time zone and time zone enties in the registry. However, 1.3 had a problem to detect other time zones on Windows correctly, which bug was fixed in 1.4. As a result of the fix, 1.4 checks more parameters, such as the DST transition rules. Then, it can't find the time zone entry in the registry which is the same one as the current time zone because the SP3 time zone change isn't reflected in the current time zone information. In any case, the workaround operation is REQUIRED in order to reflect the SP3 time zone change (fix) in the system. Otherwise, Windows 2000 itself can't support the correct DST transitions in Australia/Sydney. ###@###.### 2003-08-06
06-08-2003

WORK AROUND Add -Duser.timezone=Australia/Sydney using Java Plug-in Control Panel ("Advanced" -> "Java Runtime Parameters"). ###@###.### 2002-10-17 Another workaround is to swich to another time zone (such as Tokyo) and back to Sydney using the Date/Time properties control panel. ###@###.### 2002-11-22
17-10-2002