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

Date functions report different date in _05 release vs _06

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: