United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6609737 DateFormat incorrect for German locale
6609737 : DateFormat incorrect for German locale

Details
Type:
Bug
Submit Date:
2007-09-26
Status:
Resolved
Updated Date:
2012-12-20
Project Name:
JDK
Resolved Date:
2008-02-14
Component:
globalization
OS:
windows_xp
Sub-Component:
locale-data
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
6u10

Related Reports
Backport:
Backport:
Relates:
Relates:
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :
On windows:
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode)

On Linux:
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
Linux h114155 2.4.25 #3 SMP Sun Apr 4 19:32:54 CEST 2004 i686 i686 i386 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
The full output of a time with DateFormat is not as expected for a German locale.
As you can see in the example, there are several problems with it. First, it doesn't add leading zeros and uses a dot instead of a colon for separating hours from minutes. While this is a format that may be used somewhere in Germany, it is not the correct one according to the significant standards.
Second, the code of the time zone is not translated. According to http://de.wikipedia.org/wiki/Zeitzone#UTC_bis_UTC.2B3 there are five time zones with a German name and acronym:
- WEZ for WET, the West European Time
- WESZ for WEST/WEDT, the West European Summer Time/Daylight Time
- MEZ for CET, the Central European Time
- MESZ for CEST/CEDT, the Central European Summer Time/Daylight Time
- OEZ for EET, the East European Time

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the provided source code.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Output at time of execution:
00:37 Uhr MEZ
ACTUAL -
Output at time of execution:
0.37 Uhr CET

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.text.DateFormat;
import java.util.Locale;
import java.util.Date;

public class DateFormatTest
{
	public static void main(String[] args)
	{
		Locale l = new Locale("de", "DE");
		DateFormat df = DateFormat.getTimeInstance(DateFormat.FULL, l);
		System.out.println(df.format(new Date()));
	}
}
---------- END SOURCE ----------

                                    

Comments
EVALUATION

Consulted with native german colleague.
After a discussion, the timezone abbreaviations and names should be localized as submitter proposed:

------- TimeZoneNames_de.java -------
58,59c58,59
<       String CET[] = new String[] {"Zentraleurop\u00e4ische Zeit", "CET",
<                                    "Zentraleurop\u00e4ische Sommerzeit", "CEST"};
---
>       String CET[] = new String[] {"Mitteleurop\u00e4ische Zeit", "MEZ",
>                                    "Mitteleurop\u00e4ische Sommerzeit", "MESZ"};
80,81c80,81
<       String EET[] = new String[] {"Osteurop\u00e4ische Zeit", "EET",
<                                    "Osteurop\u00e4ische Sommerzeit", "EEST"};
---
>       String EET[] = new String[] {"Osteurop\u00e4ische Zeit", "EEZ",
>                                    "Osteurop\u00e4ische Sommerzeit", "EESZ"};
156,157c156,157
<       String WET[] = new String[] {"Westeurop\u00e4ische Zeit", "WET",
<                                    "Westeurop\u00e4ische Sommerzeit", "WEST"};
---
>       String WET[] = new String[] {"Westeurop\u00e4ische Zeit", "WEZ",
>                                    "Westeurop\u00e4ische Sommerzeit", "WESZ"};
                                     
2008-01-15
EVALUATION

The decision to change just time format pattern is based on:
when you look onto other timezone names you will realize that for geographic regions the word "Zentral" is used, not "Mittel".
                                     
2008-01-11
EVALUATION

Consulting the CLDR and DIN 5008 at http://www.intertast.de/p0400010.htm
section 6.2 - Uhrzeit
There is a conflict, following DIN and submitter's request, fixing the full time pattern as
"HH:mm' Uhr ' z"
                                     
2007-12-13
EVALUATION

After evaluating the timezone abbreviations accross all the Java supported languages I decided not to touch them.
Just fix the time pattern.
                                     
2007-10-04
EVALUATION

According to the CLDR 1.5.0 the full format should be "HH:mm:ss v" which leads into the "00:37:00" (taking a time from description).
In the CLDR also exist two proposals for "H:mm 'Uhr' v" displaying the time as "0:37 Uhr"
The character "v" should be replaced by "z" in order to have displayed CET or MEZ.
Fix: j2se:src/share/classes/sun/text/resources/FormatData_de.java

Regarding the untranslated timezone there should be two changes in
j2se:src/share/classes/sun/util/resources/TimeZoneNames_de.java
String CET[] = new String[] {"Zentraleurop??ische Zeit", "CET",
                             "Zentraleurop??ische Sommerzeit", "CEST"};
Change the long name to:
Mitteleurop??ische Zeit/Mitteleurop??ische Sommerzeit
abbreviation to:
MEZ/MESZ

Fixing abbreviations will be required for quite all timezone names.
                                     
2007-10-03
EVALUATION

Jiri will take care of it.
thanks
Yong
                                     
2007-09-28



Hardware and Software, Engineered to Work Together