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

TimeZone object have no information about transitions for EST timezone

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.2
    • core-libs

      FULL PRODUCT VERSION :
      j2sdk1.4.2_13 installation package

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP Professional. 5.1.2600 SP2 build 2600

      A DESCRIPTION OF THE PROBLEM :
      TimeZone object has not information about Day Light saving transitions when created with EST timezone. It is working fine for "PST" timezone.



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      TimeZone tz = TimeZone.getTimeZone("EST");
      Then see the value of tz.transitions,

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Non zero array with 235 elements

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
          public static void main (String[] param) {
              long tickStart = Calendar.getInstance().getTimeInMillis();

              TimeZone tz = TimeZone.getTimeZone("EST");
              Calendar cal = Calendar.getInstance(tz);
              DateFormat df = DateFormat.getInstance();
              df.setCalendar(cal);


              cal.set(Calendar.YEAR, 2007);
              cal.set(Calendar.MONTH, Calendar.MARCH);
              cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
              cal.set(Calendar.DAY_OF_WEEK_IN_MONTH, 2);
              cal.set(Calendar.HOUR_OF_DAY, 1);
              cal.set(Calendar.MINUTE, 1);
              cal.set(Calendar.SECOND, 0);
              cal.set(Calendar.MILLISECOND, 0);

              for (int inc=0; inc < 10; inc++) {
                  cal.add(Calendar.MINUTE, 15);
                  Date currD = cal.getTime();
                  System.out.println ("Date=" + df.format(currD));
              }

              long tickEnd = Calendar.getInstance().getTimeInMillis();
              System.out.println("Time elapsed is " + (tickEnd - tickStart));
          }

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

            peytoia Yuka Kamiya (Inactive)
            okutsu Masayoshi Okutsu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: