Name: rlT66838 Date: 12/07/99
C:\jdk1.1.8\bin>java -version
java version "1.1.8"
The SimpleDateFormat.format method is inconsistent in formatting the zone_id.
For some timezone, it is the zone_id, such as EST, PST. In some other case,
such as ACT, the formated output becomes "GMT+9:30".
Here is the test program to demonstrate the problem:
import java.util.*;
import java.text.*;
public class test {
public static void main(String args[]) {
Date dateOpened = new Date();
SimpleDateFormat mySimpleDateFormat = new SimpleDateFormat("MMM dd yyyy HH:mm:ss zzz");
mySimpleDateFormat.setTimeZone(TimeZone.getTimeZone("ACT"));
System.out.println(mySimpleDateFormat.format(dateOpened));
}
}
Here is the output:
C:\jdk1.1.8\bin>java test
Dec 08 1999 04:41:12 GMT+09:30
The expected output is:
Dec 08 1999 04:41:12 ACT
The problem also appears on zone_id of "AGT" which becomes "GMT-3:00".
(Review ID: 98759)
======================================================================