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
This commit is contained in:
Warren Levy 2000-11-28 20:11:46 +00:00 committed by Warren Levy
parent 48c4d691be
commit 1326d0c47d
3 changed files with 30 additions and 3 deletions

View File

@ -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()

View File

@ -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,

View File

@ -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;
*/