diff --git a/libjava/ChangeLog b/libjava/ChangeLog index db3f1887f99..d8d1d25cd90 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,10 @@ +2000-11-28 Warren Levy + + * java/text/DateFormatSymbols.java (zoneStringsDefault): Added + more time zone entries. + * java/text/SimpleDateFormat.java (format): Added case for + TIMEZONE_FIELD. + 2000-11-28 Bryce McKinlay * java/io/DataInputStream.java: Merge classpath docs. Call in.read() diff --git a/libjava/java/text/DateFormatSymbols.java b/libjava/java/text/DateFormatSymbols.java index c8250c9344a..9e8bc0c65c8 100644 --- a/libjava/java/text/DateFormatSymbols.java +++ b/libjava/java/text/DateFormatSymbols.java @@ -65,6 +65,8 @@ public class DateFormatSymbols extends Object }; private static String[][] zoneStringsDefault = { + { "GMT", "Greenwich Mean Time", "GMT", + /**/ "Greenwich Mean Time", "GMT", "GMT" }, { "PST", "Pacific Standard Time", "PST", /**/ "Pacific Daylight Time", "PDT", "San Francisco" }, { "MST", "Mountain Standard Time", "MST", @@ -82,7 +84,21 @@ public class DateFormatSymbols extends Object { "HST", "Hawaii Standard Time", "HST", /**/ "Hawaii Daylight Time", "HDT", "Honolulu" }, { "AST", "Alaska Standard Time", "AST", - /**/ "Alaska Daylight Time", "ADT", "Anchorage" } + /**/ "Alaska Daylight Time", "ADT", "Anchorage" }, + { "PST8PDT", "Pacific Standard Time", "PST", + /******/ "Pacific Daylight Time", "PDT", "San Francisco" }, + { "MST7MDT", "Mountain Standard Time", "MST", + /******/ "Mountain Daylight Time", "MDT", "Denver" }, + { "CST6CDT", "Central Standard Time", "CST", + /******/ "Central Daylight Time", "CDT", "Chicago" }, + { "EST5EDT", "Eastern Standard Time", "EST", + /******/ "Eastern Daylight Time", "EDT", "Boston" }, + { "AST4ADT", "Atlantic Standard Time", "AST", + /******/ "Atlantic Daylight Time", "ADT", "Halifax" }, + { "HST10HDT", "Hawaii Standard Time", "HST", + /*******/ "Hawaii Daylight Time", "HDT", "Honolulu" }, + { "AST9ADT", "Alaska Standard Time", "AKST", + /******/ "Alaska Daylight Time", "AKDT", "Anchorage" } }; // These are each arrays with a value for SHORT, MEDIUM, LONG, FULL, diff --git a/libjava/java/text/SimpleDateFormat.java b/libjava/java/text/SimpleDateFormat.java index e2f70cddcc6..c0332bf71d8 100644 --- a/libjava/java/text/SimpleDateFormat.java +++ b/libjava/java/text/SimpleDateFormat.java @@ -454,7 +454,11 @@ public class SimpleDateFormat extends DateFormat withLeadingZeros(theCalendar.get(Calendar.HOUR)-1,p.size,buffer); break; case TIMEZONE_FIELD: - // TODO + TimeZone zone = theCalendar.getTimeZone(); + boolean isDST = theCalendar.get(Calendar.DST_OFFSET) != 0; + // FIXME: XXX: This should be a localized time zone. + String zoneID = zone.getDisplayName(isDST, p.size > 3 ? TimeZone.LONG : TimeZone.SHORT); + buffer.append(zoneID); break; default: throw new IllegalArgumentException("Illegal pattern character"); @@ -1088,7 +1092,7 @@ public class SimpleDateFormat extends DateFormat /* case TIMEZONE_FIELD: - // TODO + // TODO: FIXME: XXX break; */