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

(tz) Wrong behavior JDK 1.3.1 in GregorianCalendar at DST boundary time

    XMLWordPrintable

Details

    • b02
    • x86
    • windows_2000, windows_2003

    Description

      Customer Problem Description:
      -----------------------------

      FULL PRODUCT VERSION :
      java version "1.4.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03) Java
      HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)

      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      If I initiate a GregorianCalendar to the time at DST
      boundery I got a different output with JDK 1.3.1 and 1.4.


      REGRESSION. Last worked in version 1.3.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Just run this small programm with JDK 1.4 and then with
      1.3.1



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      JDK version utc time
      1.4.0_01 returns 1017539999000 (Sun Mar 31,2002 3:59:59
      Europe/Berlin)
      1.3.1 returns 1017536399000 (Sun Mar 31,2002 1:59:59
      Europe/Berlin)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      // DST switch on 31 March 2002 at 2:00:00
      //
      // |-------|-------X-------|-------|
      // 12:00 01:00 03:00 04:00 5:00
      // ^
      // |
      // daylight switch from 2:00 to 3:00 by Europe/Berlin

      Calendar cal = new GregorianCalendar(2002, Calendar.MARCH, 31, 2, 59, 59);
      cal.setTimeZone(TimeZone.getTimeZone("Europe/Berlin"));
      long time = cal.getTime().getTime();
      System.out.println(time);

      How to reproduce it:

        // DST switch on 31 March 2002 at 2:00:00 by Europe/Berlin
        //
        // |-------|-------X-------|-------|
        // 12:00 01:00 03:00 04:00 5:00
        // ^
        // |
        // daylight switch from 2:00 to 3:00

      To reproduce you have just to run this with JDK 1.3.1 and JDK 1.4 to see the
      difference:

        Calendar cal = new GregorianCalendar(2002, Calendar.MARCH, 31, 2, 59, 59);
        cal.setTimeZone(TimeZone.getTimeZone("Europe/Berlin"));
        long time = cal.getTime().getTime();
        System.out.println(time);

      JDK version utc time in ms
      1.4.0_01 1017539999000 (Sun Mar 31, 2002 3:59:59 Europe/Berlin)
      1.3.1 1017536399000 (Sun Mar 31, 2002 1:59:59 Europe/Berlin)

      Attachments

        Issue Links

          Activity

            People

              kevinw Kevin Walls
              cprasadsunw Ck Prasad (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: