United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4803100 (tz) Incorrect default timezone for Santiago, Chile on Win32.
JDK-4803100 : (tz) Incorrect default timezone for Santiago, Chile on Win32.

Details
Type:
Bug
Submit Date:
2003-01-14
Status:
Resolved
Updated Date:
2005-10-12
Project Name:
JDK
Resolved Date:
2003-11-05
Component:
core-libs
OS:
windows_xp
Sub-Component:
java.util:i18n
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.1
Fixed Versions:
5.0 (b28)

Related Reports
Backport:

Sub Tasks

Description
Name: nt126004			Date: 01/14/2003


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

FULL OPERATING SYSTEM VERSION :

Microsoft Windows XP [Version 5.1.2600]

ADDITIONAL OPERATING SYSTEMS :

Windows 2000, perhaps other Win32 as well.


A DESCRIPTION OF THE PROBLEM :
If the Windows timezone is set to "Santiago", with a GMT
offset of -4, the JRE uses a default timezone of
"America/Caracas", when it should be using
"America/Santiago". Both time zones have a -4 offset, but
they have different daylight savings rules.

As a result, Java apps appear to be an hour behind during
summer in Chile.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Set Windows timezone to Santiago, GMT -4.
2. Run the attached code.

EXPECTED VERSUS ACTUAL BEHAVIOR :
Actual results:

default timezone = America/Caracas
correct timezone = America/Santiago
Time with default timezone = 16/12/02 00:00
Time with correct timezone = 16/12/02 01:00

Expected results:

default timezone = America/Santiago
correct timezone = America/Santiago
Time with default timezone = 16/12/02 00:00
Time with correct timezone = 16/12/02 00:00


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------

import java.util.TimeZone;
import java.util.Calendar;
import java.util.Date;
import java.text.DateFormat;

public class TZTest
{

	public static void main(String[] argv)
	{

		TimeZone defaultTZ = TimeZone.getDefault();
		System.out.println("default timezone = " + defaultTZ.getID());
		TimeZone correctTZ = TimeZone.getTimeZone("America/Santiago");
		System.out.println("correct timezone = " + correctTZ.getID());
		Calendar calendar = Calendar.getInstance();
		calendar.set(2002, 11, 16, 0, 0);
		Date date = calendar.getTime();
		DateFormat df = DateFormat.getInstance();
		System.out.println("Time with default timezone = " + df.format(date));
		df.setTimeZone(correctTZ);
		System.out.println("Time with correct timezone = " + df.format(date));
	}
}
---------- END SOURCE ----------

CUSTOMER WORKAROUND :
Manually set the timezone to the correct value.
(Review ID: 179188) 
======================================================================

                                    

Comments
SUGGESTED FIX

Make the following change to test/java/util/TimeZone/tools/win32/win-java.txt and generate tzmappings.

*** /tmp/geta17267	Tue Jan 14 20:02:01 2003
--- win-java.txt	Tue Jan 14 19:47:26 2003
***************
*** 86,92 ****
  #
  # New in Windows 2000 Beta 3
  #
! "Pacific SA Standard Time"		"America/Caracas"
  "SE Asia Standard Time"			"Asia/Bangkok"
  #
  # New in Windows 2000 SP1 and Windows XP (beta)
--- 86,92 ----
  #
  # New in Windows 2000 Beta 3
  #
! "Pacific SA Standard Time"		"America/Santiago"
  "SE Asia Standard Time"			"Asia/Bangkok"
  #
  # New in Windows 2000 SP1 and Windows XP (beta)

###@###.### 2003-01-15
                                     
2003-01-15
WORK AROUND

There are two workarounds.

1) Specify -Duser.timezone=America/Santiago for starting java.

2) Make the following change to <JRE_HOME>\lib\tzmappings (text file).

***************
*** 64,71 ****
  Greenland Standard Time:-1,80:GL:America/Godthab:
  Newfoundland:-1,81::America/St_Johns:
  Newfoundland Standard Time:-1,81::America/St_Johns:
! Pacific SA:-1,82::America/Caracas:
! Pacific SA Standard Time:-1,82::America/Caracas:
  SA Western:-1,82::America/Caracas:
  SA Western Standard Time:-1,82::America/Caracas:
  SA Pacific:-1,83::America/Bogota:
--- 64,71 ----
  Greenland Standard Time:-1,80:GL:America/Godthab:
  Newfoundland:-1,81::America/St_Johns:
  Newfoundland Standard Time:-1,81::America/St_Johns:
! Pacific SA:-1,82::America/Santiago:
! Pacific SA Standard Time:-1,82::America/Santiago:
  SA Western:-1,82::America/Caracas:
  SA Western Standard Time:-1,82::America/Caracas:
  SA Pacific:-1,83::America/Bogota:

###@###.### 2003-01-15
                                     
2003-01-15
EVALUATION

The tzmappings file for Windows has the wrong mapping for America/Santiago. See Work Around.
###@###.### 2003-01-15
                                     
2003-01-15
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger
tiger-beta

FIXED IN:
tiger-beta

INTEGRATED IN:
tiger-b28
tiger-beta


                                     
2004-06-14



Hardware and Software, Engineered to Work Together