-
Bug
-
Resolution: Fixed
-
P4
-
8u40
-
b57
-
x86_64
-
windows_7
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8084614 | emb-9 | Masayoshi Okutsu | P4 | Resolved | Fixed | team |
JDK-8086839 | 8u65 | Masayoshi Okutsu | P4 | Resolved | Fixed | b01 |
JDK-8076036 | 8u60 | Masayoshi Okutsu | P4 | Resolved | Fixed | b10 |
JDK-8138137 | emb-8u65 | Unassigned | P4 | Resolved | Fixed | b01 |
JDK-8078995 | emb-8u60 | Masayoshi Okutsu | P4 | Resolved | Fixed | team |
FULL PRODUCT VERSION :
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows 7 Professional Service Pack 1
A DESCRIPTION OF THE PROBLEM :
The java.text.DateFormat.format() method returns inconsistent values for months if the Date object comes from a Calendar with german Locale and a time value in March:
For a pattern "MMM" the format is "Mrz"
For a pattern "MMM yyyy" the format is "Mär 2015"
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
execute the provided class
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Mär
Mär 2015
or
Mrz
Mrz 2015
ACTUAL -
Mrz
Mär 2015
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;
public class CalendarLocaleMarchBug {
public static void printDate (Calendar c, String pattern) {
SimpleDateFormat f = new SimpleDateFormat(pattern);
f.setCalendar(c);
String res1 = f.format(c.getTime());
System.out.println(res1);
}
public static void main(String[] args) {
Calendar c = new GregorianCalendar(Locale.GERMAN);
c.set(2015,02,20);
printDate(c,"MMM");
printDate(c,"MMM yyyy");
}
}
---------- END SOURCE ----------
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows 7 Professional Service Pack 1
A DESCRIPTION OF THE PROBLEM :
The java.text.DateFormat.format() method returns inconsistent values for months if the Date object comes from a Calendar with german Locale and a time value in March:
For a pattern "MMM" the format is "Mrz"
For a pattern "MMM yyyy" the format is "Mär 2015"
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
execute the provided class
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Mär
Mär 2015
or
Mrz
Mrz 2015
ACTUAL -
Mrz
Mär 2015
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;
public class CalendarLocaleMarchBug {
public static void printDate (Calendar c, String pattern) {
SimpleDateFormat f = new SimpleDateFormat(pattern);
f.setCalendar(c);
String res1 = f.format(c.getTime());
System.out.println(res1);
}
public static void main(String[] args) {
Calendar c = new GregorianCalendar(Locale.GERMAN);
c.set(2015,02,20);
printDate(c,"MMM");
printDate(c,"MMM yyyy");
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8076036 DateFormat in german locale returns wrong value for month march
-
- Resolved
-
-
JDK-8078995 DateFormat in german locale returns wrong value for month march
-
- Resolved
-
-
JDK-8084614 DateFormat in german locale returns wrong value for month march
-
- Resolved
-
-
JDK-8086839 DateFormat in german locale returns wrong value for month march
-
- Resolved
-
-
JDK-8138137 DateFormat in german locale returns wrong value for month march
-
- Resolved
-
- relates to
-
JDK-8136539 SimpleDateFormat won't parse German "Mrz" for March
-
- Closed
-
(1 relates to)