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

en_ZA local has unusable time format

XMLWordPrintable

    • b12
    • x86
    • solaris_2.5.1, windows_2003

        FULL PRODUCT VERSION :
        1.5.0.8

        ADDITIONAL OS VERSION INFORMATION :
        Not OS specific

        A DESCRIPTION OF THE PROBLEM :
        The local for en_ZA has an unusable medium time format, a 12 hour clock without am or pm. The timezone should be included or the clock should be changed to a 24 hour clock

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Below is some simple code to display the date formats for a specific locale. Simply call it with 2 parameters( java TestLocal en ZA) you will see (if you do this in the afternoon :-) That the local uses a 12hour clock with no AM/PM

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import java.util.Locale;
        import java.util.Date;
        import java.text.DateFormat;
        class TestLocale
        {
            public static final void main(String[] args)
            {

        Locale locale = new Locale(args[0],args[1]);
        System.out.println("got locale for "+ locale.getDisplayLanguage()+" " +
        locale.getDisplayCountry());

        DateFormat dl = DateFormat.getDateInstance(DateFormat.LONG, locale);
        System.out.println("Long date is "+ dl.format(new Date()));

        DateFormat tl = DateFormat.getTimeInstance(DateFormat.LONG, locale);
        System.out.println("Long time is "+ tl.format(new Date()));


        DateFormat dm = DateFormat.getDateInstance(DateFormat.MEDIUM, locale);
        System.out.println("MEDIUM date is " + dm.format(new Date()));

        DateFormat tm = DateFormat.getTimeInstance(DateFormat.MEDIUM, locale);
        System.out.println("Medium time is "+ tm.format(new Date()));

        DateFormat ds = DateFormat.getDateInstance(DateFormat.SHORT, locale);
        System.out.println("SHORT date is "+ ds.format(new Date()));

        DateFormat ts = DateFormat.getTimeInstance(DateFormat.SHORT, locale);
        System.out.println("Short time is "+ ts.format(new Date()));
            }
        }
        ---------- END SOURCE ----------

              jtusla Jiri Tusla (Inactive)
              ndcosta Nelson Dcosta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: