JDK-6609725 : Short time format incorrect for English (South Africa)
  • Type: Bug
  • Component: globalization
  • Sub-Component: translation
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2003
  • CPU: x86
  • Submitted: 2007-09-26
  • Updated: 2010-07-29
  • Resolved: 2007-10-03
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 5.2.3790]

A DESCRIPTION OF THE PROBLEM :
The short time format for English (South Afica) is hh:mm.  How can it be 12 hours without am/pm?

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the following codes:

        String [] countries = {"ie", "gb", "zw", "ph", "za", "us", "au", "bz", "ca", "jm", "nz", "tt", ""};
        
        for (int i = 0; i < countries.length; i++)
        {
            Locale lo = new Locale ("en", countries[i]);
            DateFormat tf = SimpleDateFormat.getTimeInstance(DateFormat.SHORT, lo);
            if (tf != null)
            {
                String pattern = ((SimpleDateFormat)tf).toPattern();
                System.out.println ("Locale is " + lo.getDisplayLanguage () + "(" + lo.getDisplayCountry () + ").  Pattern is  " + pattern);
            }
            
        }

The results are :

Locale is English(Ireland).  Pattern is  HH:mm
Locale is English(United Kingdom).  Pattern is  HH:mm
Locale is English(Zimbabwe).  Pattern is  h:mm a
Locale is English(Philippines).  Pattern is  h:mm a
Locale is English(South Africa).  Pattern is  hh:mm
Locale is English(United States).  Pattern is  h:mm a
Locale is English(Australia).  Pattern is  HH:mm
Locale is English(Belize).  Pattern is  h:mm a
Locale is English(Canada).  Pattern is  h:mm a
Locale is English(Jamaica).  Pattern is  h:mm a
Locale is English(New Zealand).  Pattern is  HH:mm
Locale is English(Trinidad and Tobago).  Pattern is  h:mm a
Locale is English().  Pattern is  h:mm a


The pattern of English (South Africa) is hh:mm.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I check the Windows Regional settings, the English (South Africa) is 12 hours with am/pm.

Locale is English(South Africa).  Pattern is  h:mm a

ACTUAL -
Locale is English(South Africa).  Pattern is  hh:mm


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
        String [] countries = {"ie", "gb", "zw", "ph", "za", "us", "au", "bz", "ca", "jm", "nz", "tt", ""};
        
        for (int i = 0; i < countries.length; i++)
        {
            Locale lo = new Locale ("en", countries[i]);
            DateFormat tf = SimpleDateFormat.getTimeInstance(DateFormat.SHORT, lo);
            if (tf != null)
            {
                String pattern = ((SimpleDateFormat)tf).toPattern();
                System.out.println ("Locale is " + lo.getDisplayLanguage () + "(" + lo.getDisplayCountry () + ").  Pattern is  " + pattern);
            }
            
        }

The results are :

Locale is English(Ireland).  Pattern is  HH:mm
Locale is English(United Kingdom).  Pattern is  HH:mm
Locale is English(Zimbabwe).  Pattern is  h:mm a
Locale is English(Philippines).  Pattern is  h:mm a
Locale is English(South Africa).  Pattern is  hh:mm
Locale is English(United States).  Pattern is  h:mm a
Locale is English(Australia).  Pattern is  HH:mm
Locale is English(Belize).  Pattern is  h:mm a
Locale is English(Canada).  Pattern is  h:mm a
Locale is English(Jamaica).  Pattern is  h:mm a
Locale is English(New Zealand).  Pattern is  HH:mm
Locale is English(Trinidad and Tobago).  Pattern is  h:mm a
Locale is English().  Pattern is  h:mm a

---------- END SOURCE ----------

Comments
EVALUATION Jiri will take care of it.
27-09-2007