[tz] leap-seconds.list format
brian.inglis at systematicsw.ab.ca
brian.inglis at systematicsw.ab.ca
Wed Feb 7 15:03:07 UTC 2024
On 2024-02-07 02:17, Martin Burnicki via tz wrote:
> Byron Torres via tz wrote:
>> Good day,
>>
>> I write here to you knowledgeable people in the hopes you can
>> clarify some things regarding the format of leap-seconds.list file.
>> Please forgive me if there is a more appropriate place to ask.
>>
>> Recently it seems the IERS has changed the format of the
>> leap-seconds.list file they serve[1], from the old format by NIST[2].
>
>> The comments are reworded, the lines wrap at a large width, and most
>> importantly, the whitespace between the decimal timestamps and
>> time-differences, previously a tab, have been replaced with spaces.
>>
>> [1] https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list
>> [2] ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list
>>
>> This, coupled with the fact that the tz repository recently began
>> fetching from this source (I understand that is because the NIST source
>> was flaky), has broken a leap-seconds.list parser[3] used by the
>> standard library of the Hare systems programming language[4], a language
>> akin to a modern C. I'm the maintainer of the Hare stdlib date/time
>> subsystem[5].
>
> Beside the file from NIST, there has been a version of the leap second file
> provided by USNO, with quite different comments.
>
> Even the comments in different releases of the file from NIST have changed over
> the years, from rewording the comments, spaces inside the comment lines, and
> even different email addresses for the contact person at NIST, Judah Levine.
>
> In my opinion the most important thing to keep in mind is whether the source is
> authoritative and the file can be downloaded securely, i.e. via https rather
> than ftp.
>
> You could also check the hash of the file that is part of the data in the file,
> but the hash only verifies the integrity of the file. This may have been
> important at the time when the file format was invented (~2000) and it was
> downloaded via a modem/serial connection to detect transmission errors, but IMO
> this is obsolete today when you download the file e.g. via tcp/https.
>
> Is there a specific reason why your parser also checks the *comments* of the
> file, and distinguishes between tabs and spaces?
>
> From my perspective as a software developer, that doesn't sound very sensible.
> IMO, comments should simply be ignored, and tabs or spaces should simply be
> considered white space. That's e.g. how ntpd handles these files, and ntpd
> accepts any of the (old or newer) files from NIST, the old files from USNO, and
> files provided by IERS.
IIRC the leap-seconds.list file loosely follows the format used by NTP for
digital security certificate files generated by ntp-keygen.
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
-- Antoine de Saint-Exupéry
More information about the tz
mailing list