[LEAPSECS] BBC radio Crowd Science
Steve Summit
scs+ls at eskimo.com
Sun Jan 29 15:09:55 EST 2017
Tom Van Baak wrote
> John Sauter wrote:
>> I had thought that TAI-UTC was the only information needed to convert
>> from TAI to UTC [...] Is
>> my new belief correct that you need both TAI-UTC and the knowledge that
>> a leap second is in progress to convert from TAI to UTC?
>
> Hmm, it sounds like your new belief is wrong too. [...] The table is all
> you need to decide how to convert between TAI/UTC and UTC/TAI. Yes, the
> code gets tricky near +/- N seconds of midnight, where N is |TAI-UTC|.
I think John's point is that if all I have is a TAI timestamp t,
and an interface to a leapsecond table that returns taioffset(t)
for TAI time t, that's not quite enough to unambiguously compute
the corresponding UTC timestamp. If I take t and subtract
taioffset(t), I don't know whether the UTC result I get should
end in :60, so to speak.
As it happens, just last week I write a TAI-to-UTC conversion
function, and I had to invent a new interface into my leapsecond
table: it returns the TAI-UTC offset for a given time t, *and* it
returns the time of the transition nearest to t, which is what's
needed to make the leap-second determination John is talking about.
More information about the LEAPSECS
mailing list