Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Hungarian date format changed

3525328Aug 21 2017 — edited Oct 17 2017

Hungarian date format has been changed in jdk-9+181.

The short format was (in Java8) "yyyy.MM.dd." e.g. "2017.08.18.".

In Java9 it is "y. MM. dd." e.g. "2017. 08. 18." (extra space after the dots).

I do not know why. It causes compatibility problems.

Comments

Pallavi Sonal-Oracle

I tried with JDK 9-ea+181 on Windows 7 and don't see any extra space after the dots while using SHORT date format for the locale ("hr", "HR"). Following is the output I got - 22.08.2017.

Can you please specify the exact locale that you used ?

3525328

Linux (SLES11)

Java(TM) SE Runtime Environment (build 9+181)

Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

Date today = new Date();

SimpleDateFormat format = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.SHORT, new Locale("hu","HU"));

System.out.println(format.toPattern());

System.out.println(format.format(today));

y. MM. dd.

2017. 08. 22.

With JDK 9, the default locale data provider is changed to CLDR. Refer : JDK-8043554. As per the CLDR , the date format for Hungarian Locale is "GGGGG y. M. d." , hence the change. If you require the same format as in JDK 8 when the default locale data provider was JRE, you can use the option : -Djava.locale.providers=JRE

3525328

Thank you, it does work.

However I do not understand why the default behaviour has been changed.

1 - 4

Post Details

Added on Aug 21 2017
4 comments
2,910 views