United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6645271 Wrong date format for Croatian (hr) locale
JDK-6645271 : Wrong date format for Croatian (hr) locale

Details
Type:
Bug
Submit Date:
2007-12-25
Status:
Closed
Updated Date:
2012-12-20
Project Name:
JDK
Resolved Date:
2011-03-07
Component:
globalization
OS:
windows_xp
Sub-Component:
locale-data
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Backport:

Sub Tasks

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

Jiri will take care of it.
                                     
2007-12-25
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.
                                     
2008-01-08
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.
                                     
2008-01-18
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.
                                     
2008-02-27
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
+                 }
+             }
                                     
2009-12-09



Hardware and Software, Engineered to Work Together