-
Bug
-
Resolution: Fixed
-
P4
-
18
-
b10
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8294491 | 19.0.2 | Christoph Langer | P4 | Resolved | Fixed | b02 |
JDK-8313285 | 17.0.10-oracle | Johny Jose | P4 | Resolved | Fixed | b04 |
JDK-8294318 | 17.0.6 | Christoph Langer | P4 | Resolved | Fixed | b01 |
JDK-8294319 | 11.0.18 | Christoph Langer | P4 | Resolved | Fixed | b01 |
When a match cannot be made directly against a recognized region/timezone from the tzdb.dat, TimeZone.getSystemGMTOffsetID() is invoked to find the GMT based offset to calculate the offset and find the corresponding time.
The native code reached in TimeZone_md.c has a bug for platforms that are not MacOS, where daylight savings is not respected.
To reproduce the issue:
TZ="MEZ-1MESZ,M3.5.0,M10.5.0" java -cp . TimeTest
with the following test , TimeTest.java
import java.util.Calendar;
import java.util.TimeZone;
import java.util.Date;
import java.text.SimpleDateFormat;
public class TimeTest {
public static void main(String args[]) {
Date time = Calendar.getInstance().getTime();
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss.SSS");
System.out.println("Calendar.getInstance().getTime() = "+time);
System.out.println("SimpleDateFormat = "+sdf.format(time));
}
}
Reproducible on Linux on Z (s390x) OpenJDK18 (jdk18+38 Temurin)
TZ="MEZ-1MESZ,M3.5.0,M10.5.0" ~/jdk-18+36/bin/java -cp . TimeTest
Calendar.getInstance().getTime() = Thu Apr 28 15:55:16 GMT+01:00 2022
SimpleDateFormat = 28.04.2022 15:55:16.171
Zone ID can be set according to guidelines below:
https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
- backported by
-
JDK-8294318 [REDO] DST not applying properly with zone id offset set with TZ env variable
-
- Resolved
-
-
JDK-8294319 [REDO] DST not applying properly with zone id offset set with TZ env variable
-
- Resolved
-
-
JDK-8294491 [REDO] DST not applying properly with zone id offset set with TZ env variable
-
- Resolved
-
-
JDK-8313285 [REDO] DST not applying properly with zone id offset set with TZ env variable
-
- Resolved
-
- duplicates
-
JDK-8288369 java/util/TimeZone/CustomTzIDCheckDST.java failed with "RuntimeException: Got unexpected timezone information"
-
- Closed
-
- relates to
-
JDK-8285838 DST not applying properly with zone id offset set with TZ env variable
-
- Closed
-
-
JDK-6992725 SimpleDateFormat.format(Date) is an hour late for MEZ-1MESZ,M3.5.0,M10.5.0
-
- Closed
-
-
JDK-8297335 Date and time handling in timezone that supports daylight savings time
-
- Open
-
- links to
-
Commit openjdk/jdk11u-dev/6e53ef27
-
Commit openjdk/jdk17u-dev/f5c0fc37
-
Commit openjdk/jdk19u/a1cc5be6
-
Commit openjdk/jdk/3c325641
-
Review openjdk/jdk11u-dev/1328
-
Review openjdk/jdk17u-dev/662
-
Review openjdk/jdk19u/16
-
Review openjdk/jdk/9312