gpt4 book ai didi

java - 为什么 java tzupdater 添加闰秒?

转载 作者:行者123 更新时间:2023-11-30 08:55:37 27 4
gpt4 key购买 nike

有一些引用资料提到 Java 会忽略闰秒:

How can a 1 year old (java) lib correctly perform an UTC Time formatting, considering a newly introduced leap second

Do Java system milliseconds take account of leap seconds?

JDK-4272347 : (cal/tz) support leap seconds ticket

还没有文档Timezone Data Versions in the JRE Software提及:

New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49.

第 3 方 Java 库 Time4J 使用它自己的闰秒列表。

为什么java的tzupdater工具被Java忽略了却要加上闰秒?

最佳答案

我现在仔细查看了 TZUPDATER 和 IANA 的发行说明(在其实验位置 github/eggert/tz):

TZUPDATER 说:

The Mexican state of Quintana Roo, represented by America/Cancun, will shift from Central Time with DST to Eastern Time without DST on 2015-02-01 at 02:00. Chile will not change clocks in April or thereafter; its new standard time will be its old daylight saving time. This affects America/Santiago, Pacific/Easter, and Antarctica/Palmer. New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49.

IANA 表示:

Release 2015a - 2015-01-29 22:35:20 -0800

 Changes affecting future time stamps 

The Mexican state of Quintana Roo, represented by America/Cancun,
will shift from Central Time with DST to Eastern Time without DST
on 2015-02-01 at 02:00. (Thanks to Steffen Thorsen and Gwillim Law.)

Chile will not change clocks in April or thereafter; its new standard time
will be its old daylight saving time. This affects America/Santiago,
Pacific/Easter, and Antarctica/Palmer. (Thanks to Juan Correa.)


New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49.
(Thanks to Tim Parenti.)

由此看来,很可能是 Oracle 员工刚刚完成了复制和粘贴,而没有多想内容是否真的与 Java 发行版相关。唯一的变化是删除作者引用。当然,事实仍然是,在实际的 OpenJDK 和 Oracle-Java 发行版中,没有代码或位置可以加载这种闰秒数据。

在我自己对此 SO-question 的回答中我还指出了最新的相关 mail statement Threeten 项目负责人最终放弃了对闰秒的临时可用计划支持。因此,您对 Java-8 的乐观态度是没有道理的。

顺便说一句,Time4J 的最新版本 v2.3 现在可以部署 IANA-TZDB 中包含的闰秒信息,正如您从 TZUPDATER 工具中期望的那样。

关于java - 为什么 java tzupdater 添加闰秒?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28918934/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com