[kaffe] Timezone Expression

Ito Kazumitsu ito.kazumitsu at hidec.co.jp
Sun Jan 23 21:05:49 PST 2005


In message "[kaffe] Timezone Expression"
    on 05/01/24, Ito Kazumitsu <ito.kazumitsu at hidec.co.jp> writes:

> So, Thu Oct 28 22:00:27 is correct. But anyway the timezone expression
> "JDT" is wrong and it must be "JST".

java.util.TimeZone.getDisplayName(dst, SHORT, locale) returns
zoneinfo[i][2] if dst == false, where zoneinfo[i] returned
by java.text.DateFormatSymbols(locale).getZoneStrings() is
an array of Strings containing:

   0 - The non-localized time zone id string.
   1 - The long name of the time zone (standard time).
   2 - The short name of the time zone (standard time).
   3 - The long name of the time zone (daylight savings time).
   4 - the short name of the time zone (daylight savings time).

So, java.util.TimeZone.getDisplayName() is doing a right thing
if java.text.DateFormatSymbols.getZoneStrings() returns a
correct array.

java.text.DateFormatSymbols.getZoneStrings() just returns
what is returned by ResourceBundle.getObject("zoneStrings").

Let's look at gnu/java/locale/LocaleInformation_en.java,
which says

  private static final String[][] zoneStrings =
  {
  ...
    { "JST", "Japan Standard Time", "JDT", "Japan Daylight Time",  "Asia/Tokyo"},
  ...

Now I understand how the timezone name becomes "JDT".

Unfortunately, Sun's API document does not clearly define
what java.text.DateFormatSymbols.getZoneStrings() should
return.  But lookig at the output from Sun's
java.text.DateFormatSymbols.getZoneStrings(), I guess
what java.util.TimeZone.getDisplayName() expects is
correct.

So, all the definitions of zoneString in gnu/java/locale/LocaleInformation*
should be corrected.




More information about the kaffe mailing list