This works with Java 11 but does not work with Java 17
DateTimeFormatter format = DateTimeFormatter.ofPattern("MMM dd, yyyy")
.withLocale(Locale.UK);
format.parse("Sep 29, 1988");
Java 17 stacktrace:
Exception in thread "main" java.time.format.DateTimeParseException: Text 'Sep 29, 1988' could not be parsed at index 0
at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2052)
at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1880)
My Java version:
openjdk version "17" 2021-09-14 LTS
OpenJDK Runtime Environment Zulu17.28+13-CA (build 17+35-LTS)
OpenJDK 64-Bit Server VM Zulu17.28+13-CA (build 17+35-LTS, mixed mode, sharing)
What has changed?
en_GB
. Not sure if this change in behaviour is intentional (it probably is) but it's very inconvenient. – Antioch