提交 805f8f1c 编写于 作者: A aefimov

8027848: The ZoneInfoFile doesn't honor future GMT offset changes

Reviewed-by: sherman, coffeys
上级 1dba94ef
......@@ -406,6 +406,9 @@ public final class ZoneInfoFile {
// LocalDateTime.of(2037, 1, 1, 0, 0, 0).toEpochSecond(ZoneOffset.UTC));
private static final long LDT2037 = 2114380800L;
//Current time. Used to determine future GMToffset transitions
private static final long CURRT = System.currentTimeMillis()/1000;
/* Get a ZoneInfo instance.
*
* @param standardTransitions the standard transitions, not null
......@@ -427,8 +430,10 @@ public final class ZoneInfoFile {
boolean willGMTOffsetChange = false;
// rawOffset, pick the last one
if (standardTransitions.length > 0)
if (standardTransitions.length > 0) {
rawOffset = standardOffsets[standardOffsets.length - 1] * 1000;
willGMTOffsetChange = standardTransitions[standardTransitions.length - 1] > CURRT;
}
else
rawOffset = standardOffsets[0] * 1000;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册