-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
19
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
MacOS Ventura 13.0
64-Bit Server VM (build 19.0.1+10-21, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
DateTimeFormatter.ofPattern("MMM") outputs the incorrect length for the month of September. expected is 3 characters in length, but java 19 outputs 4 characters (Sept). All other months are correctly 3 characters in length.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
output the month for September using DateTimeFormatter.ofPattern("MMM")
expected "Sep", but result is "Sept"
all other months are correct except September
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
ACTUAL -
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sept
Oct
Nov
Dec
---------- BEGIN SOURCE ----------
public class Test {
public static void main(String[] args) {
LocalDate localDate = LocalDate.now();
DateTimeFormatter monthFormatter = DateTimeFormatter.ofPattern("MMM");
// outputs correctly except for September (Sept instead of Sep)
for (int i = 1; i <= 12; i++)
System.out.println(localDate.withMonth(i).format(monthFormatter));
}
}
---------- END SOURCE ----------
FREQUENCY : always
MacOS Ventura 13.0
64-Bit Server VM (build 19.0.1+10-21, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
DateTimeFormatter.ofPattern("MMM") outputs the incorrect length for the month of September. expected is 3 characters in length, but java 19 outputs 4 characters (Sept). All other months are correctly 3 characters in length.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
output the month for September using DateTimeFormatter.ofPattern("MMM")
expected "Sep", but result is "Sept"
all other months are correct except September
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
ACTUAL -
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sept
Oct
Nov
Dec
---------- BEGIN SOURCE ----------
public class Test {
public static void main(String[] args) {
LocalDate localDate = LocalDate.now();
DateTimeFormatter monthFormatter = DateTimeFormatter.ofPattern("MMM");
// outputs correctly except for September (Sept instead of Sep)
for (int i = 1; i <= 12; i++)
System.out.println(localDate.withMonth(i).format(monthFormatter));
}
}
---------- END SOURCE ----------
FREQUENCY : always
- duplicates
-
JDK-8256837 SimpleDateFormat can not parse date anymore
-
- Closed
-
- relates to
-
JDK-8293917 SimpleDateFormat yy-MMM-dd formats September as Sept
-
- Closed
-