shell – Unix时间和闰秒

关于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时间戳的闰秒根本就不存在。

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...