JDK-4505478 : Incorrect Daylight Savings for JDK 1.2 and JDK 1.3
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.2.2
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6
  • CPU: generic
  • Submitted: 2001-09-21
  • Updated: 2001-09-25
  • Resolved: 2001-09-25
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The following JDKs will display the wrong DST for Australia/Sydney timezone:

java 1.3.0     incorrect
java 1.2.2_09  incorrect
java 1.2.2_08  incorrect
java 1.2.2_07a incorrect
java 1.2.2_06  incorrect

My test program is below:

import java.util.*;

public class LocalTime{
    public static void main(String args[]){
        Calendar c = Calendar.getInstance();
        String des, delim = "[],";
        StringTokenizer destok;

        System.out.println(new Date().toString());

        des = c.toString();
        destok = new StringTokenizer(des, delim);
        System.out.println("System default calendar settings:");
        while (destok.hasMoreTokens())
            System.out.println("  " + destok.nextToken());
    }
}

Test Cases:

After running the program, the differences in the output from JDK 1.3.1, 1.2.2.07a, and 1.2.2.06 are:

startMonth=9     jdk 1.3.1
startMonth=7     jdk 1.2.2.07a and 1.2.2.06

startTimeMode=1  jdk 1.3.1
no such attr     jdk 1.2.2.07a and 1.2.2.06

endTime=7200000  jdk 1.3.1
endTime=10800000 jdk 1.2.2.07a and 1.2.2.06

endTimeMode=1    jdk 1.3.1
no such attr     jdk 1.2.2.07a and 1.2.2.06

HOUR=6,HOUR_OF_DAY=18  jdk 1.3.1
HOUR=7,HOUR_OF_DAY=19  jdk 1.2.2.07a and 1.2.2.06

DST_OFFSET=0           jdk 1.3.1
DST_OFFSET=3600000     jdk 1.2.2.07a and 1.2.2.06

Comments
WORK AROUND Programming workaround such as manually setting the hour of the day in your Calendar instance. OR Use either JDK 1.2.2.05a or JDK 1.3.1
11-06-2004

EVALUATION SimpleTimeZone can represent DST schedules as a single set of start and end rules DST. Some time zones, such as some of the Australia time zones in 2000, change their DST schedules, which can't be addressed by SimpleTimeZone. This problem has been fixed in Merlin Beta. See bug#'s 4230123 and 4257314. 1.3.0 was released in 2000, and therefore, took the 2000 DST rules for all time zones. 1.3.1 was released in 2001 and took the 2001 rules, and so on. If a fix is required on 1.3.0 and 1.2.2_xx, this bug should be escalated. ###@###.### 2001-09-25
25-09-2001