Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4116747

DateFormat for Japanese locale is broken on 116H

XMLWordPrintable

    • generic
    • generic

      See the result below from the test prgram:

      import java.text.*;
      import java.util.*;

      class dttest {
              static final int[] format = {
                      DateFormat.FULL,
                      DateFormat.LONG,
                      DateFormat.MEDIUM,
                      DateFormat.SHORT,
              };

              public static void main(String[] arg) {
                      Date date = new Date();
                      for (int i = 0; i<format.length; i++) {
                              DateFormat fmt = DateFormat.getDateTimeInstance(format[i],
                              format[i]);
                              DateFormat fmt_en = DateFormat.getDateTimeInstance(format[i],
                              format[i], Locale.ENGLISH);
                              System.out.println(fmt.format(date));
                              System.out.println(fmt_en.format(date) + "\n");
                      }
              }
      }

      Test was done on Solaris2.5.1 under ja locale.

      1.1.5 fcs

      1998 03 03 15 17 21 JST
      Monday, March 2, 1998 10:17:21 o'clock PM PST

      1998/03/03 15:17:21:JST
      March 2, 1998 10:17:21 PM PST

      98/03/03 15:17:21
      02-Mar-98 10:17:21 PM

      03/03 15:17
      3/2/98 10:17 PM

      1.1.6H
      1998 3 3 13 24 53 GMT+09:00
      Tuesday, March 3, 1998 1:24:53 o'clock PM JST

      1998/03/03 13:24:53:GMT+09:00
      March 3, 1998 1:24:53 PM JST

      1998/03/03 13:24:53
      03-Mar-98 1:24:53 PM

      98/03/03 13:24
      3/3/98 1:24 PM

      Problems:
        Time zone is always GMT+09:00 under ja locale.
        because kZoneStrings in DateFormatZoneData_ja containes incorrect timezone
        string.
        This is 116 regression.

        Formatted date and time is inconsistent between Japanese and English locale.
        The full format on 1.1.5 has the day of the week, but 1.1.6 doesn't.
        English has AM/PM but not for Japanese on both 1.1.5 and 1.1.6.
        This is probably RFE.

        Era definition is missing for Japanese locale.
        This is regression.
        There is no equivarent entry in LocaleElement
                  { "Eras",
                      new String[] { // era strings
                          "BC",
                          "AD"
                      }
        for Japanese locale. It should be translated to Kigenzen and Kigengo.

            rgillamsunw Richard Gillam (Inactive)
            sishidasunw Shoji Ishida (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: