-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
b20
-
x86
-
windows_xp
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2152916 | OpenJDK6 | Iris Clark | P3 | Resolved | Fixed | b02 |
FULL PRODUCT VERSION :
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
EXTRA RELEVANT SYSTEM CONFIGURATION :
default locale: de_AT
time zone: central european time (Berlin, Vienna), daylight saving.
A DESCRIPTION OF THE PROBLEM :
%tz of java.util.Formatter shows a wrong GMT timezone offset.
See example code.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run the attached source code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
the GMT timezone offset of "%tz" should be the GMT time zone offset -
like "Z" of SimpleDateFormat.
SimpleDateFormat: 2005-06-08 12:56:22.177 +0200
format date+time: should be identical
ACTUAL -
SimpleDateFormat: 2005-06-08 12:56:22.177 +0200
format date+time: 2005-06-08 12:56:22.177 +0100
... %tz gives a wrong GMT time offset.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Date now = new Date ();
System.out.println ("SimpleDateFormat: " +
new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss.SSS Z").format (now));
System.out.format ("format date+time: %tF %<tT.%<tL %<tz%n", now);
---------- END SOURCE ----------
###@###.### 2005-06-16 11:48:03 GMT
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
EXTRA RELEVANT SYSTEM CONFIGURATION :
default locale: de_AT
time zone: central european time (Berlin, Vienna), daylight saving.
A DESCRIPTION OF THE PROBLEM :
%tz of java.util.Formatter shows a wrong GMT timezone offset.
See example code.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run the attached source code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
the GMT timezone offset of "%tz" should be the GMT time zone offset -
like "Z" of SimpleDateFormat.
SimpleDateFormat: 2005-06-08 12:56:22.177 +0200
format date+time: should be identical
ACTUAL -
SimpleDateFormat: 2005-06-08 12:56:22.177 +0200
format date+time: 2005-06-08 12:56:22.177 +0100
... %tz gives a wrong GMT time offset.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
Date now = new Date ();
System.out.println ("SimpleDateFormat: " +
new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss.SSS Z").format (now));
System.out.format ("format date+time: %tF %<tT.%<tL %<tz%n", now);
---------- END SOURCE ----------
###@###.### 2005-06-16 11:48:03 GMT
- backported by
-
JDK-2152916 (fmt) Formatter "%tz" returns wrong GMT time offset during daylight savings time
-
- Resolved
-
- relates to
-
JDK-6603263 (fmt) @plainlink => @linkplain
-
- Closed
-