[tz] JavaScript IANA date/time library, now with support for leap seconds, TAI, TDT

John Sauter John_Sauter at systemeyescomputerstore.com
Mon Apr 26 19:41:39 UTC 2021

On Mon, 2021-04-26 at 19:40 +0100, Tony Finch wrote:
> I think the things that are missing are:
>   * A standard representation of TAI (as discussed in this thread).
>     There's some convergence here already: I believe PTP matches
>     time at the start of 1972, and counts TAI seconds after that
> point,
>     which matches the tz "right" zones. But there isn't a solid
> meaning
>     outside the period of 1972 - present.
The obvious choice is to also count TAI seconds before 1972.  Is there
a problem with doing that?  The customary zero point for the integer
used by PTP is 1970, though some users of a count of SI seconds set the
zero point to 1958.  If you want to name times before the zero point
you will need to handle negative values, is that your concern?

>   * A standard API for getting the kernel's idea of TAI and its leap
>     indicator - something like a simplified ntp_gettime but aimed at
>     applications rather than ntp daemons.
>     Applications need to see the leap indicator so that they can tell
> if
>     the kernel's idea of leap seconds matches the application's idea.
> They
>     might differ if NTP isn't working or if NTP uses leap smear.
It is very difficult for an application to overcome errors in the
kernel.  I think the most we can expect is that an application detect
that the kernal has a problem and refuse to run until it is fixed.  For
example, if the Linux kernel's adjtimex function is disabled, an
application which needs to detect if a leap second is in progress is
out of luck, and should fail with an error message.

>   * A standard way to obtain the leap second table. This requires
> some
>     combination of either the tzdist protocol or normal software
> updates,
>     combined with support in tz for using TAI without stepping in the
>     "right" timezone swamp.
This doesn't sound impossible, though I grant you it would take some
effort, and there doesn't seem to be anyone with the contacts, skills
and motivation to get it done at the moment.

> Repeat for each language's standard library.

And also repeat for each operating system.

> Windows is supposed to have TAI support but I haven't looked into how
> it
> works.
I believe Microsoft Windows has support for UTC, including leap seconds
after 2018.
    John Sauter (John_Sauter at systemeyescomputerstore.com)

get my PGP public key with gpg --locate-external-keys
John_Sauter at systemeyescomputerstore.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://mm.icann.org/pipermail/tz/attachments/20210426/d2d0d588/attachment.sig>

More information about the tz mailing list