JDK-6609737 : DateFormat incorrect for German locale
  • Type: Bug
  • Component: globalization
  • Sub-Component: locale-data
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-09-26
  • Updated: 2012-12-20
  • Resolved: 2008-02-14
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 Other
6u10 b12Fixed 7Fixed OpenJDK6Fixed
Related Reports
Relates :  
Relates :  
Relates :  
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"};
15-01-2008

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".
11-01-2008

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"
13-12-2007

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

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.
03-10-2007

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