-
Bug
-
Resolution: Fixed
-
P5
-
5.0
-
b96
-
x86
-
linux
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2140525 | 5.0u12 | Jiri Tusla | P5 | Resolved | Fixed | b01 |
JDK-2201064 | 1.4.2_18 | Abhijit Saha | P4 | Resolved | Fixed | b06 |
JDK-2157916 | 1.4.2_17-rev | Abhijit Saha | P4 | Resolved | Fixed | b12 |
FULL PRODUCT VERSION :
1.4.2_10, 5.0_06
ADDITIONAL OS VERSION INFORMATION :
Linux daffy 2.6.15-1-686 #1 Wed Jan 18 15:04:35 UTC 2006 i686 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
The UK full format for UK locale dates does not include the day of the week. I don't see why the US and Canada full formats should include the day of the week and not the UK one. If I code the pattern by hand it works fine. Unfortunatly as I am developing a J2EE web application (JBoss with Sun's JDK) I am using the locale provide by the broswer.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
UK full date pattern: EEEE, d MMMM yyyy
UK long date pattern: dd MMMM yyyy
US full date pattern: EEEE, MMMM d, yyyy
US long date pattern: MMMM d, yyyy
CA full date pattern: EEEE, MMMM d, yyyy
CA long date pattern: MMMM d, yyyy
UK full date: Tuesday, 7 February 2006
UK long date: 07 February 2006
US full date: Tuesday, February 7, 2006
US long date: February 7, 2006
CA full date: Tuesday, February 7, 2006
CA long date: February 7, 2006
By Hand: Tuesday, 7 February 2006
ACTUAL -
UK full date pattern: dd MMMM yyyy
UK long date pattern: dd MMMM yyyy
US full date pattern: EEEE, MMMM d, yyyy
US long date pattern: MMMM d, yyyy
CA full date pattern: EEEE, MMMM d, yyyy
CA long date pattern: MMMM d, yyyy
UK full date: 07 February 2006
UK long date: 07 February 2006
US full date: Tuesday, February 7, 2006
US long date: February 7, 2006
CA full date: Tuesday, February 7, 2006
CA long date: February 7, 2006
By Hand: Tuesday, 7 February 2006
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.GregorianCalendar;
class UKDateBug {
public static void main (String argv[] ) {
/*using explicit constant for locale*/
DateFormat dfFullUK = DateFormat.getDateInstance(DateFormat.FULL, Locale.UK);
DateFormat dfFullUS = DateFormat.getDateInstance(DateFormat.FULL, Locale.US);
DateFormat dfFullCA = DateFormat.getDateInstance(DateFormat.FULL, Locale.CANADA);
DateFormat dfLongUK = DateFormat.getDateInstance(DateFormat.LONG, Locale.UK);
DateFormat dfLongUS = DateFormat.getDateInstance(DateFormat.LONG, Locale.US);
DateFormat dfLongCA = DateFormat.getDateInstance(DateFormat.LONG, Locale.CANADA);
GregorianCalendar now = new GregorianCalendar();
System.out.println("UK full date pattern: " + ((SimpleDateFormat) dfFullUK).toPattern());
System.out.println("UK long date pattern: " + ((SimpleDateFormat) dfLongUK).toPattern());
System.out.println();
System.out.println("US full date pattern: " + ((SimpleDateFormat) dfFullUS).toPattern());
System.out.println("US long date pattern: " + ((SimpleDateFormat) dfLongUS).toPattern());
System.out.println();
System.out.println("CA full date pattern: " + ((SimpleDateFormat) dfFullCA).toPattern());
System.out.println("CA long date pattern: " + ((SimpleDateFormat) dfLongCA).toPattern());
System.out.println();
System.out.println("UK full date: " + dfFullUK.format(now.getTime()));
System.out.println("UK long date: " + dfLongUK.format(now.getTime()));
System.out.println();
System.out.println("US full date: " + dfFullUS.format(now.getTime()));
System.out.println("US long date: " + dfLongUS.format(now.getTime()));
System.out.println();
System.out.println("CA full date: " + dfFullCA.format(now.getTime()));
System.out.println("CA long date: " + dfLongCA.format(now.getTime()));
SimpleDateFormat format = new SimpleDateFormat("EEEE, d MMMM yyyy", Locale.UK);
System.out.println();
System.out.println("By Hand: " + format.format(now.getTime()));
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Code the pattern by hand (see code) if you really must have a senstable UK format. I am letting the incomplete full version stand.
1.4.2_10, 5.0_06
ADDITIONAL OS VERSION INFORMATION :
Linux daffy 2.6.15-1-686 #1 Wed Jan 18 15:04:35 UTC 2006 i686 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
The UK full format for UK locale dates does not include the day of the week. I don't see why the US and Canada full formats should include the day of the week and not the UK one. If I code the pattern by hand it works fine. Unfortunatly as I am developing a J2EE web application (JBoss with Sun's JDK) I am using the locale provide by the broswer.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
UK full date pattern: EEEE, d MMMM yyyy
UK long date pattern: dd MMMM yyyy
US full date pattern: EEEE, MMMM d, yyyy
US long date pattern: MMMM d, yyyy
CA full date pattern: EEEE, MMMM d, yyyy
CA long date pattern: MMMM d, yyyy
UK full date: Tuesday, 7 February 2006
UK long date: 07 February 2006
US full date: Tuesday, February 7, 2006
US long date: February 7, 2006
CA full date: Tuesday, February 7, 2006
CA long date: February 7, 2006
By Hand: Tuesday, 7 February 2006
ACTUAL -
UK full date pattern: dd MMMM yyyy
UK long date pattern: dd MMMM yyyy
US full date pattern: EEEE, MMMM d, yyyy
US long date pattern: MMMM d, yyyy
CA full date pattern: EEEE, MMMM d, yyyy
CA long date pattern: MMMM d, yyyy
UK full date: 07 February 2006
UK long date: 07 February 2006
US full date: Tuesday, February 7, 2006
US long date: February 7, 2006
CA full date: Tuesday, February 7, 2006
CA long date: February 7, 2006
By Hand: Tuesday, 7 February 2006
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.GregorianCalendar;
class UKDateBug {
public static void main (String argv[] ) {
/*using explicit constant for locale*/
DateFormat dfFullUK = DateFormat.getDateInstance(DateFormat.FULL, Locale.UK);
DateFormat dfFullUS = DateFormat.getDateInstance(DateFormat.FULL, Locale.US);
DateFormat dfFullCA = DateFormat.getDateInstance(DateFormat.FULL, Locale.CANADA);
DateFormat dfLongUK = DateFormat.getDateInstance(DateFormat.LONG, Locale.UK);
DateFormat dfLongUS = DateFormat.getDateInstance(DateFormat.LONG, Locale.US);
DateFormat dfLongCA = DateFormat.getDateInstance(DateFormat.LONG, Locale.CANADA);
GregorianCalendar now = new GregorianCalendar();
System.out.println("UK full date pattern: " + ((SimpleDateFormat) dfFullUK).toPattern());
System.out.println("UK long date pattern: " + ((SimpleDateFormat) dfLongUK).toPattern());
System.out.println();
System.out.println("US full date pattern: " + ((SimpleDateFormat) dfFullUS).toPattern());
System.out.println("US long date pattern: " + ((SimpleDateFormat) dfLongUS).toPattern());
System.out.println();
System.out.println("CA full date pattern: " + ((SimpleDateFormat) dfFullCA).toPattern());
System.out.println("CA long date pattern: " + ((SimpleDateFormat) dfLongCA).toPattern());
System.out.println();
System.out.println("UK full date: " + dfFullUK.format(now.getTime()));
System.out.println("UK long date: " + dfLongUK.format(now.getTime()));
System.out.println();
System.out.println("US full date: " + dfFullUS.format(now.getTime()));
System.out.println("US long date: " + dfLongUS.format(now.getTime()));
System.out.println();
System.out.println("CA full date: " + dfFullCA.format(now.getTime()));
System.out.println("CA long date: " + dfLongCA.format(now.getTime()));
SimpleDateFormat format = new SimpleDateFormat("EEEE, d MMMM yyyy", Locale.UK);
System.out.println();
System.out.println("By Hand: " + format.format(now.getTime()));
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Code the pattern by hand (see code) if you really must have a senstable UK format. I am letting the incomplete full version stand.
- backported by
-
JDK-2157916 Full date format in DateFormat does not include day of the week for UK locale
- Resolved
-
JDK-2201064 Full date format in DateFormat does not include day of the week for UK locale
- Resolved
-
JDK-2140525 Full date format in DateFormat does not include day of the week for UK locale
- Resolved
- relates to
-
JDK-6707039 java/util/Locale/InternationalBAT.java test is not up to date starting from 1.4.2_17 rev b12
- Closed