加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

shell – Unix时间和闰秒

发布时间:2020-12-15 19:11:28 所属栏目:安全 来源:网络整理
导读:关于Unix(POSIX)时间, Wikipedia说: Due to its handling of leap seconds,it is neither a linear representation of time nor a true representation of UTC. 但是Unix date命令实际上似乎并不知道它们 $ date -d '@867715199' --utcMon Jun 30 23:59:59
关于Unix(POSIX)时间, Wikipedia说:

Due to its handling of leap seconds,it is neither a linear representation of time nor a true representation of UTC.

但是Unix date命令实际上似乎并不知道它们

$ date -d '@867715199' --utc
Mon Jun 30 23:59:59 UTC 1997
$ date -d '@867715200' --utc
Tue Jul  1 00:00:00 UTC 1997

虽然应该有一个飞跃第二在那里在Mon Jun 30 23:59:60 UTC 1997。

这是否意味着只有date命令忽略了闰秒,而Unix时间的概念没有?

每天的秒数固定为 Unix timestamps。

The Unix time number is zero at the Unix epoch,and increases by
exactly 86400 per day since the epoch.

所以它不能代表闰秒。操作系统将会减慢时间,以适应这一点。到目前为止,Unix时间戳的闰秒根本就不存在。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读