Joe Touch <touch@xxxxxxx> wrote:
>
> The Posic spec describes how to convert seconds since epoch to UTC; it
> is that conversion where leap seconds come into play.
No, it describes the reverse, how to convert broken-down UTC time to seconds since the epoch. It multiplies minutes by a fixed 60s, hours by a fixed 3600s, and days by a fixed 86400s. The rest of the formula is dealing with Gregorian dates. There is no allowance for leap seconds.
> > But if the count of seconds includes the leap second, surely the
> > number representing the leap second could be printed properly as :60 ?
>
> UTC defines it that way, so if you want to output the correct UTC value,
> that is the only solution.
UTC does not define a seconds count, it is specified in terms of broken-down time only, so that doesn't really answer my question about why you say a system can't print a :60 UTC time when you say it has a seconds count which includes leap seconds.
There's also a relevant example in the NTP RFC
1972-01-01 00:00:00 - MJD 41317 - NTP 2272060800
1999-12-31 00:00:00 - MJD 51543 - NTP 3155587200
51543 - 41317 == 10226
(3155587200 - 2272060800) / 86400 == 10226
[note integer MJD numbers are always midnight]
No leap seconds, because each one is forgotten by NTP when the leap indicator bits are reset.
Tony.
--
f.anthony.n.finch <dot@xxxxxxxx> http://dotat.at/ - I xn--zr8h punycode