F-ckin Leap Seconds, how do they work?
mysidia at gmail.com
Wed Jul 4 02:33:14 UTC 2012
On 7/3/12, Vadim Antonov <avg at kotovnik.com> wrote:
> There's always a possibility of using pseudo-TAI internally by
> reconstructing it from UTC. This is not the best solution (because it
> requires systems to have long-term memory of past leap seconds, or
How about, instead of requiring systems to "remember" past leap seconds;
You represent every single timestamp instead of as
timestamp = <32-bit int, seconds since jan 1 1970 00:00:00>
You represent all system timestamps as tuples:
timestamp = ( <32-bint int seconds since jan 1 1970 00:00:00>,
<integer representing the leap-second offset
since jan 1 1970> )
No need to retain a history. Just retain the data in the same way
that Hours, Minutes, and Second are retained.
Comparison is simple.
(Timestamp2 - Offset2) - (Timestamp1 - Offset1)
The downside is you can no longer set your system clock by hand,
because humans won't know the right number of "leap seconds" to
supply when setting the time from their wall clock.
That's a problem necesitating you keep a history anyways.
For time to be universally coordinated, it has to be coordinated.
One of the basic requirements for system time is that it interacts
with humans, and
humans have to be able to set their clock from conventional time
sources which are based on local time, without the machine having to
be constantly updated or reach out on a network and figure out how
that translates into a reasonable machine time.
More information about the NANOG