JDK-6275152 : Calendar.getInstance() gives incorrect time on Asia/Irkutsk, summer time
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-05-24
  • Updated: 2011-02-16
  • Resolved: 2005-06-02
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Windows XP Service Pack 2

A DESCRIPTION OF THE PROBLEM :
Java determinates incorrect time zone in Asia/Irkutsk. Java supposes that it is Asia/Ulaanbaatar. Asia/Irkutsk use winter/summer time, Asia/Ulaanbaatar not.  So, System.out.println(Calendar.getInstance().getTime()); prints wrong time when there is a summer time in Asia/Irkutsk. It prints one hour earlier time.
For example, it prints Sat May 07 09:53:12 ULAT 2005 when time is 10:53.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set computer locale GMT+8, Ulaanbaatar/Irkutsk, use summer time; and date, when summer time is used, for example now (7th May) in Windows Control Panel. Execute System.out.println(Calendar.getInstance().getTime()); . It will print wrong time.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Valid system time.
ACTUAL -
Wrong system time.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.util.Calendar;

public class Test {

	public static void main(String[] args) {
		System.out.println(Calendar.getInstance().getTime());
	}
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Set time zone to Asia/Irkutsk manually on program start. But it is not a good solution.
###@###.### 2005-05-24 11:57:10 GMT

Comments
EVALUATION 1.5.0_03 uses tzdata2003d from the public tz database (aka the Olson public source). The problem was fixed in tzdata2004a, which support went to mustang. Closing this CR as a duplicate of 5054346. ###@###.### 2005-05-24 13:18:14 GMT tzdata2005g went to 5.0u4 b03. (2124189) ###@###.### 2005-05-25 03:02:21 GMT The tzdata2005g fix for 5.0u4 is being backed out due to 6277315. Reopening this CR. ###@###.### 2005-06-02 05:13:22 GMT Closing this CR again as a duplicate of 5054346. ###@###.### 2005-06-02 05:41:17 GMT
24-05-2005