JDK-6645271 : Wrong date format for Croatian (hr) locale
  • Type: Bug
  • Component: globalization
  • Sub-Component: locale-data
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-12-25
  • Updated: 2012-12-20
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u12Fixed 7 b80Fixed
Description
FULL PRODUCT VERSION :
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Tested on Windows 2000, XP. Most likely OS-independent.

A DESCRIPTION OF THE PROBLEM :
The Croatian locale still has a wrong numeric date format. for the SHORT and MEDIUM forms. E.g. 14 October 1985 is formatted as "1985.10.14". This date format is wrong.

The correct format should be "14.10.1985." (MEDIUM) or "14.10.85." (SHORT), just as it is in the Serbian locale (sr_RS).

  See also:

- The Windows locale definition, which is correct.
- Bug# 4807540 for further explanation by other users.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Dates should be expressed in Croatian standard format: day period month period year period.


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.util.*;
import java.text.*;

public class Test {
   public static void main(String[] params) {
       Locale locale = new Locale("hr", "HR");
       Locale.setDefault(locale);

       String s = DateFormat.getDateInstance(DateFormat.MEDIUM, locale).format(new Date());
       System.out.println(s);
   }
}

---------- END SOURCE ----------

Comments
EVALUATION src/share/classes/sun/text/resources/FormatData_hr_HR.java + { "DateTimePatterns", + new String[] { + "HH:mm:ss z", // full time pattern + "HH:mm:ss z", // long time pattern + "HH:mm:ss", // medium time pattern + "HH:mm", // short time pattern + "yyyy. MMMM dd", // full date pattern + "yyyy. MMMM dd", // long date pattern + "dd.MM.yyyy.", // medium date pattern + "dd.MM.yy.", // short date pattern + "{1} {0}" // date-time pattern + } + }
09-12-2009

EVALUATION Talking to the director of croation language institute. She confirmed that the short format is correct like "dd.MM.yy." (note the dot at the end) but should not be officially used. OK, now I have all required infos, could fix as requested.
27-02-2008

EVALUATION Thanks to Yuka I now have some official web resources: http://www.predsjednik.hr/ - government, president site, uses: dd.MM.yyyy http://www.vlada.hr/ - government portal, uses: dd.MM.yyyy http://www.ihjj.hr - croatian language institute, uses dd.MM.yyyy Asked for clarification for short format on language institute. Waiting for reply.
18-01-2008

EVALUATION Looking onto a several resources, how they define the pattern. CLDR: yyyy.MM.dd, yyyy.MM.dd windows: d.M.yy, dd.MM.yyyy, - there are more with same order - day-month-year Solaris: %Y.%m.%d Linux: %d.%m.%Y Based on this the score is 2:2. Please supply official specification. Thanks.
08-01-2008

EVALUATION Jiri will take care of it.
25-12-2007