Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6521162

(tz) New US Daylight Saving not working properly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      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 ----------

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              okutsu Masayoshi Okutsu
              Reporter:
              ndcosta Nelson Dcosta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: