[LEAPSECS] article for Metrologia
Steffen Nurpmeso
steffen at sdaoden.eu
Sat Oct 29 14:10:29 EDT 2022
Joseph Gwinn wrote in
<20221029134819386898.e3c27921 at comcast.net>:
|General comment:
|
|The POSIX standards which unix and variants follow uses a string time
|format that looks like UTC, but is not, because leap seconds are
|never applied. This was done precisely because an isolated unix box
|had no access to leap-second information; this was the norm in that
|day, long before networks and GPS.
|
|So, those faulty designers of yore had insufficient clairvoyance
|skills.
It came up here often, and POSIX itself writes it "has been
debated on a number of occasions", and "Those applications which
do care about leap seconds can determine how to handle them in
whatever way those applications feel is best."
So it says "POSIX.1-2017 do not take leap seconds into account
when computing seconds since the Epoch.", and
Coordinated Universal Time (UTC) includes leap seconds. However,
in POSIX time (seconds since the Epoch), leap seconds are
ignored (not applied) to provide an easy and compatible method
of computing time differences. Broken-down POSIX time is
therefore not necessarily UTC, despite its appearance.
This is why you need other functions to be able to calculate time
spans and such correctly, and for that you need a machine oriented
base timer, and an offset.
Maybe funnily this week's Monday on source-changes-d@ of NetBSD
...
|If you use a monotonic timer to sample the POSIX clock before and
|after a leap second, the POSIX clock will appear to have taken twice
|as long as it should to pass the leap second.
Just to note that the next leap second could be a negative one.
I mean it does not make sense to look into the past. Programmers
must be enabled to perform the correct calculations, and in my
personal opinion adjusting human time cannot be that.
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
More information about the LEAPSECS
mailing list