Running:
Locale locale = Locale.US;
String pattern = DateTimeFormatterBuilder.getLocalizedDateTimePattern(
FormatStyle.LONG,
FormatStyle.LONG,
Chronology.ofLocale(locale),
locale);
System.out.println("pattern: " + pattern);
Outputs:
pattern: MMMM d, yyyy h:mm:ss a z // Java 8.0.171-oracle
pattern: MMMM d, y 'at' h:mm:ss a z // Java 11.0.0-open
I found that Oracle uses the iana-tz database (https://data.iana.org/time-zones/tz-link.html) for managing timezone data (see https://www.oracle.com/technetwork/java/javase/tzdata-versions-138805.html).
However, I did not find anything about such a change of the standard date formatting. Investigating the source code, it seems that in Java 8, the function LocaleResources.getJavaTimeFormatData()
loads the sun.text.resources
bundle, while in Java 11, it loads the sun.text.resources.cdlr
bundle.
My question is: Is such a change documented somewhere, possibly with a reason for it?
Also, what is the best way to ensure compatibility with existing databases? For now, we have a list of recognized patterns, so I am thinking about adding the old patterns to my list of recognizable patterns by parsing the new patterns.
Another notable change is:
Locale locale = Locale.US;
String pattern = DateTimeFormatterBuilder.getLocalizedDateTimePattern(
FormatStyle.SHORT, FormatStyle.MEDIUM, Chronology.ofLocale(locale), locale);
System.out.println("pattern: " + pattern);
Outputs:
pattern: M/d/yy h:mm:ss a // Java 8.0.171-oracle
pattern: M/d/yy, h:mm:ss a // Java 11.0.0-open