-
Bug
-
Resolution: Fixed
-
P3
-
6u29
-
b04
-
x86
-
windows_xp
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8045614 | 8u25 | Yong Huang | P3 | Resolved | Fixed | b01 |
JDK-8039036 | 8u20 | Yong Huang | P3 | Resolved | Fixed | b09 |
JDK-8053841 | emb-8u26 | Yong Huang | P3 | Resolved | Fixed | b17 |
FULL PRODUCT VERSION :
JRE 1.6.0_29-b11 Java HotSpot(TM) Client VM
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
DateFormat.getDateTimeInstance() and DateFormat.getTimeInstance() methods are not displaying time in 24 hour clock format and instead display time in 12 hour format for Spanish(Chile) locale. Spanish(chile) locale uses 24 hour time format "H:mm:ss". This bug is seen in some more locales like Quechua(Ecuador).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Change the Control Panel -> Regional and Language settings to "Spanish(Chile)" and run the following code using runtime arguments as "es" "CL"
class TestLocale
{
public static final void main(String[] args)
{
Locale locale = new Locale(args[0], args[1]);
DateFormat dateTimeInstance = DateFormat.getDateTimeInstance( DateFormat.SHORT, DateFormat.MEDIUM, locale);
DateFormat timeInstance = DateFormat.getTimeInstance(DateFormat.MEDIUM, locale);
System.out.println("-----------Display in user input locale " + locale + " ----------------");
System.out.println("dateTimeInstance = "+ dateTimeInstance.format(new Date()));
System.out.println("timeInstance = "+ timeInstance.format(new Date()));
Locale defaultLocale = Locale.getDefault();
dateTimeInstance = DateFormat.getDateTimeInstance( DateFormat.SHORT, DateFormat.MEDIUM, defaultLocale);
timeInstance = DateFormat.getTimeInstance(DateFormat.MEDIUM, defaultLocale);
System.out.println("-----------Display in System default locale " + defaultLocale + " ----------------");
System.out.println("dateTimeInstance = "+ dateTimeInstance.format(new Date()));
System.out.println("timeInstance = "+ timeInstance.format(new Date()));
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
-----------Display in user input locale es_CL ----------------
dateTimeInstance = 24-01-12 18:15:49 PM
timeInstance = 18:15:49 PM
-----------Display in System default locale es_CL ----------------
dateTimeInstance = 24-01-12 18:15:49 PM
timeInstance = 18:15:49 PM
ACTUAL -
-----------Display in user input locale es_CL ----------------
dateTimeInstance = 24-01-12 06:15:49 PM
timeInstance = 06:15:49 PM
-----------Display in System default locale es_CL ----------------
dateTimeInstance = 24-01-12 06:15:49 PM
timeInstance = 06:15:49 PM
******************************************************************************
The same program run with Portuguese(Brazil) locale displays correct 24 hour format as below:
-----------Display in user input locale pt_BR ----------------
dateTimeInstance = 24/01/12 18:20:52
timeInstance = 18:20:52
-----------Display in System default locale pt_BR ----------------
dateTimeInstance = 24/01/12 18:20:52
timeInstance = 18:20:52
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class TestLocale
{
public static final void main(String[] args)
{
Locale locale = new Locale(args[0], args[1]);
DateFormat dateTimeInstance = DateFormat.getDateTimeInstance( DateFormat.SHORT, DateFormat.MEDIUM, locale);
DateFormat timeInstance = DateFormat.getTimeInstance(DateFormat.MEDIUM, locale);
System.out.println("-----------Display in user input locale " + locale + " ----------------");
System.out.println("dateTimeInstance = "+ dateTimeInstance.format(new Date()));
System.out.println("timeInstance = "+ timeInstance.format(new Date()));
Locale defaultLocale = Locale.getDefault();
dateTimeInstance = DateFormat.getDateTimeInstance( DateFormat.SHORT, DateFormat.MEDIUM, defaultLocale);
timeInstance = DateFormat.getTimeInstance(DateFormat.MEDIUM, defaultLocale);
System.out.println("-----------Display in System default locale " + defaultLocale + " ----------------");
System.out.println("dateTimeInstance = "+ dateTimeInstance.format(new Date()));
System.out.println("timeInstance = "+ timeInstance.format(new Date()));
}
---------- END SOURCE ----------
JRE 1.6.0_29-b11 Java HotSpot(TM) Client VM
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
DateFormat.getDateTimeInstance() and DateFormat.getTimeInstance() methods are not displaying time in 24 hour clock format and instead display time in 12 hour format for Spanish(Chile) locale. Spanish(chile) locale uses 24 hour time format "H:mm:ss". This bug is seen in some more locales like Quechua(Ecuador).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Change the Control Panel -> Regional and Language settings to "Spanish(Chile)" and run the following code using runtime arguments as "es" "CL"
class TestLocale
{
public static final void main(String[] args)
{
Locale locale = new Locale(args[0], args[1]);
DateFormat dateTimeInstance = DateFormat.getDateTimeInstance( DateFormat.SHORT, DateFormat.MEDIUM, locale);
DateFormat timeInstance = DateFormat.getTimeInstance(DateFormat.MEDIUM, locale);
System.out.println("-----------Display in user input locale " + locale + " ----------------");
System.out.println("dateTimeInstance = "+ dateTimeInstance.format(new Date()));
System.out.println("timeInstance = "+ timeInstance.format(new Date()));
Locale defaultLocale = Locale.getDefault();
dateTimeInstance = DateFormat.getDateTimeInstance( DateFormat.SHORT, DateFormat.MEDIUM, defaultLocale);
timeInstance = DateFormat.getTimeInstance(DateFormat.MEDIUM, defaultLocale);
System.out.println("-----------Display in System default locale " + defaultLocale + " ----------------");
System.out.println("dateTimeInstance = "+ dateTimeInstance.format(new Date()));
System.out.println("timeInstance = "+ timeInstance.format(new Date()));
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
-----------Display in user input locale es_CL ----------------
dateTimeInstance = 24-01-12 18:15:49 PM
timeInstance = 18:15:49 PM
-----------Display in System default locale es_CL ----------------
dateTimeInstance = 24-01-12 18:15:49 PM
timeInstance = 18:15:49 PM
ACTUAL -
-----------Display in user input locale es_CL ----------------
dateTimeInstance = 24-01-12 06:15:49 PM
timeInstance = 06:15:49 PM
-----------Display in System default locale es_CL ----------------
dateTimeInstance = 24-01-12 06:15:49 PM
timeInstance = 06:15:49 PM
******************************************************************************
The same program run with Portuguese(Brazil) locale displays correct 24 hour format as below:
-----------Display in user input locale pt_BR ----------------
dateTimeInstance = 24/01/12 18:20:52
timeInstance = 18:20:52
-----------Display in System default locale pt_BR ----------------
dateTimeInstance = 24/01/12 18:20:52
timeInstance = 18:20:52
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
class TestLocale
{
public static final void main(String[] args)
{
Locale locale = new Locale(args[0], args[1]);
DateFormat dateTimeInstance = DateFormat.getDateTimeInstance( DateFormat.SHORT, DateFormat.MEDIUM, locale);
DateFormat timeInstance = DateFormat.getTimeInstance(DateFormat.MEDIUM, locale);
System.out.println("-----------Display in user input locale " + locale + " ----------------");
System.out.println("dateTimeInstance = "+ dateTimeInstance.format(new Date()));
System.out.println("timeInstance = "+ timeInstance.format(new Date()));
Locale defaultLocale = Locale.getDefault();
dateTimeInstance = DateFormat.getDateTimeInstance( DateFormat.SHORT, DateFormat.MEDIUM, defaultLocale);
timeInstance = DateFormat.getTimeInstance(DateFormat.MEDIUM, defaultLocale);
System.out.println("-----------Display in System default locale " + defaultLocale + " ----------------");
System.out.println("dateTimeInstance = "+ dateTimeInstance.format(new Date()));
System.out.println("timeInstance = "+ timeInstance.format(new Date()));
}
---------- END SOURCE ----------
- backported by
-
JDK-8039036 Time display for Spanish(Chile, Ecuador ) locale doesn't show 24-hour format
-
- Resolved
-
-
JDK-8045614 Time display for Spanish(Chile, Ecuador ) locale doesn't show 24-hour format
-
- Resolved
-
-
JDK-8053841 Time display for Spanish(Chile, Ecuador ) locale doesn't show 24-hour format
-
- Resolved
-