JDK-6521162 : (tz) New US Daylight Saving not working properly
  • 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: 2007-02-05
  • Updated: 2011-02-16
  • Resolved: 2007-02-05
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

tzupdater version 1.0.0-b03
JRE time zone data version: tzdata2006p
Embedded time zone data version: tzdata2006p

FULL OS VERSION :
Windows XP

A DESCRIPTION OF THE PROBLEM :
In 2007, daylight time begins on March 11 and ends on November 4.
This is not working

THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Download Sun Java SE TZupdater tool
2. Install java -jar tzupdater.jar -u -v
3. Compile java EDTTest.java
4. Run
java sudheer.EDTTest 01/04/2006
java sudheer.EDTTest 03/04/2006
java sudheer.EDTTest 28/10/2006
java sudheer.EDTTest 30/10/2006
java sudheer.EDTTest 10/03/2007
java sudheer.EDTTest 12/03/2007
java sudheer.EDTTest 03/11/2007
java sudheer.EDTTest 05/11/2007

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected:
C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 01/04/2006
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
01/04/2006==>EST

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 03/04/2006
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
03/04/2006==>EDT

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 28/10/2006
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
28/10/2006==>EDT

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 30/10/2006
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
30/10/2006==>EST

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 10/03/2007
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
10/03/2007==>EST

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 12/03/2007
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
12/03/2007==>EDT

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 03/11/2007
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
03/11/2007==>EDT

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 05/11/2007
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
05/11/2007==>EST

Actual:
C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 01/04/2006
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
01/04/2006==>EST

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 03/04/2006
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
03/04/2006==>EST

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 28/10/2006
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
28/10/2006==>EST

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 30/10/2006
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
30/10/2006==>EST

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 10/03/2007
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
10/03/2007==>EST

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 12/03/2007
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
12/03/2007==>EST

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 03/11/2007
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
03/11/2007==>EST

C:\sudheer\jdev\mywork\Project5\classes>java sudheer.EDTTest 05/11/2007
JRE installation directory is: C:\Program Files\Java\jre1.5.0
Eastern Standard Time
05/11/2007==>EST

ERROR MESSAGES/STACK TRACES THAT OCCUR :
No Error Messages

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
/*
 * @(#)EDTTest.java   07/01/04
 *
 * Copyright (c) 2006 Sprint NEXTEL
 *
 *
 */



package sudheer;

//~--- JDK imports ------------------------------------------------------------

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.TimeZone;

//~--- classes ----------------------------------------------------------------

public class EDTTest {

    /* This code will test new US EDT */
    public static void main(String[] args) {

        // Create a DateFormat for the given TimeZone
        String s = System.getProperty("java.home", "not specified");
        String arg;

        System.out.println("JRE installation directory is: " + s);

        TimeZone         timeZone   = TimeZone.getTimeZone("EST");
        SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");

        dateFormat.setTimeZone(timeZone);

        try {

            // System.out.println(timeZone.inDaylightTime(dateFormat.parse("11/03/2007")));
            System.out.println(timeZone.getDisplayName());

             arg = args[0];
            // arg = "3/04/2006"; //inDaylightTime = true
            // arg = "12/3/2007"; //inDaylightTime = true for 2007
            //arg = "13/12/2007";

            // System.out.println(timeZone.getDSTSavings());
            if (timeZone.inDaylightTime(dateFormat.parse(arg)) == true) {
                System.out.println(arg + "==>EDT");

                // System.out.println(arg+"==>PASSED==>New Extended Daylight Non complient");
            } else {
                System.out.println(arg + "==>EST");
            }

            // System.out.println(arg+"==>FAILED==>New Extended Daylight complient");
        } catch (ParseException e) {

            // unexpected
            e.printStackTrace();
        }
    }
}

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

Comments
WORK AROUND If the time zone data has been updated with the tzupdater tool, please specify -bc and -f options to enable EST. Please refer to http://java.sun.com/javase/tzupdater_README.html for the options. Please use the long time zone IDs introduced since 1.2. e.g., "America/New_York" instead of "EST".
05-02-2007

EVALUATION This is a duplicate of 6466476.
05-02-2007