[tz] leap-seconds.list format

Martin Burnicki martin.burnicki at meinberg.de
Wed Feb 7 09:17:06 UTC 2024


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.


Martin
-- 
Martin Burnicki

Senior Software Engineer

MEINBERG Funkuhren GmbH & Co. KG
Email: martin.burnicki at meinberg.de
Phone: +49 5281 9309-414
Linkedin: https://www.linkedin.com/in/martinburnicki/

Lange Wand 9, 31812 Bad Pyrmont, Germany
Amtsgericht Hannover 17HRA 100322
Geschäftsführer/Managing Directors: Natalie Meinberg, Werner Meinberg, 
Andre Hartmann, Heiko Gerstung
Websites: https://www.meinberg.de  https://www.meinbergglobal.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://mm.icann.org/pipermail/tz/attachments/20240207/a9249e3b/attachment.sig>


More information about the tz mailing list