System.setProperty("java.locale.providers", "COMPAT,CLDR");
DateFormat dateFormat
= DateFormat.getDateInstance(DateFormat.SHORT, new Locale("sv", "SE"));
System.out.println(((SimpleDateFormat) dateFormat).toPattern());
Running on my jdk-9.0.4, this prints
yyyy-mm-dd
You might want to set the property using -Dthe command line, it should not have any meaning.
Java 9 Common Locale Data Repository (CLDR) Unicode , Java. , , Java 8. nullpointer, : CLDR .
Basil Bourque , , , , sv, , .
, , y . , SimpleDateFormat, y 80-20: 80 20. yyyy . , 4- ( 1000 9999), , .
, :
DateTimeFormatterBuilder.getLocalizedDateTimePattern(
FormatStyle.SHORT, null, IsoChronology.INSTANCE, new Locale("SV", "SE")));
(en-CY, , ) DateFormat DateTimeFormatter, , , DateFormat.