-
Bug
-
Resolution: Fixed
-
P4
-
1.4.1
-
tiger
-
x86
-
windows_2000
-
Verified
Name: rmT116609 Date: 01/23/2003
FULL PRODUCT VERSION :
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)
FULL OPERATING SYSTEM VERSION : Microsoft Windows 2000
[Version 5.00.2195], Service Pack III
A DESCRIPTION OF THE PROBLEM :
When using Slovenian locale with DateFormat, the date gets
imporperly formated.
Instead of dd.mm.yyyy (same as german), the output is yy.mm.dd.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
import java.text.DateFormat;
import java.util.Locale;
Locale si = new Locale("sl", "si");
DateFormat df = DateFormat.getDateInstance
(DateFormat.MEDIUM, si);
System.out.println(df.format(new Date()));
EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected: 13.8.2002
Actual: 2002.8.13
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.text.DateFormat;
import java.util.Locale;
Locale si = new Locale("sl", "si");
DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, si);
System.out.println(df.format(new Date()));
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
import java.text.DateFormat;
import java.util.Locale;
public DateFormat getDateInstance(Locale loc) {
if(loc.getLanguage().equals("sl")) {
loc = new Locale("de");
}
return(DateFormat.getDateInstance(DateFormat.MEDIUM,
loc));
}
(Review ID: 160704)
======================================================================