aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorWarren Levy <warrenl@cygnus.com>2000-11-28 20:11:46 +0000
committerWarren Levy <warrenl@gcc.gnu.org>2000-11-28 20:11:46 +0000
commit1326d0c47d693da34ea20e6ce1ad749e29f540d9 (patch)
tree35d2e62ad822dbf670d94c3606784d42b14e4485 /libjava
parent48c4d691bee7cfeb8cd9364b60bb2b899eba9ac0 (diff)
downloadgcc-1326d0c47d693da34ea20e6ce1ad749e29f540d9.zip
gcc-1326d0c47d693da34ea20e6ce1ad749e29f540d9.tar.gz
gcc-1326d0c47d693da34ea20e6ce1ad749e29f540d9.tar.bz2
DateFormatSymbols.java (zoneStringsDefault): Added more time zone entries.
* java/text/DateFormatSymbols.java (zoneStringsDefault): Added more time zone entries. * java/text/SimpleDateFormat.java (format): Added case for TIMEZONE_FIELD. From-SVN: r37824
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog7
-rw-r--r--libjava/java/text/DateFormatSymbols.java18
-rw-r--r--libjava/java/text/SimpleDateFormat.java8
3 files changed, 30 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index db3f188..d8d1d25 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,10 @@
+2000-11-28 Warren Levy <warrenl@cygnus.com>
+
+ * 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 <bryce@abatross.co.nz>
* 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 c8250c9..9e8bc0c 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 e2f70cd..c0332bf 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;
*/