8262110: DST starts from incorrect time in 2038

8073446: TimeZone getOffset API does not  return a dst offset between years 2038-2137

Reviewed-by: rriggs
This commit is contained in:
Naoto Sato 2021-03-26 17:13:49 +00:00
parent 3a28dc8213
commit 7284f013ea
2 changed files with 75 additions and 2 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -285,7 +285,7 @@ public class ZoneInfo extends TimeZone {
int dstoffset = tz.getOffset(msec) - rawOffset;
// Check if it's in a standard-to-daylight transition.
if (dstoffset > 0 && tz.getOffset(msec - dstoffset) == rawoffset) {
if (dstoffset > 0 && tz.getOffset(msec - dstoffset) == rawoffset && type == WALL_TIME) {
dstoffset = 0;
}