JDK-6415049 : Date functions report different date in _05 release vs _06
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-04-19
  • Updated: 2011-02-16
  • Resolved: 2006-04-25
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)

and

java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

EXTRA RELEVANT SYSTEM CONFIGURATION :
Test running on a WinXP machine in the EST (GMT-5) timezone on 28 Mar 2006.

A DESCRIPTION OF THE PROBLEM :
Day of month is reported differently on the _05 build versus _06.

What has changed between versions?
Are there any other undocumented changes.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Test program is below.  Long value presented is midnight EST on 31 Mar 2008.

Run on _05 and _06 - expect the output to be the same - it isn't!


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Output on 05:

Eastern Standard Time
-18000000
America/New_York
March 30, 2008

Output  on 06 :
Eastern Standard Time
-18000000
America/New_York
March 31, 2008
ACTUAL -
Expect to see 06 output.

REPRODUCIBILITY :
This bug can be reproduced always.

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

package test;

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

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		Date d2 = new Date(1206936000000L);
        DateFormat fmt = DateFormat.getDateInstance(DateFormat.LONG);
		
        System.out.println(TimeZone.getDefault().getDisplayName());
        System.out.println(TimeZone.getDefault().getOffset(new Date().getTime()));
        System.out.println(TimeZone.getDefault().getID());
        
        System.out.println(fmt.format(d2));
        

	}

}

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

CUSTOMER SUBMITTED WORKAROUND :
None found.

Comments
EVALUATION The daylight saving time transition rules for U.S. will change from 2007. 5.0u6 is already aware of the change and produces the local time based on the new rules.
25-04-2006