[tz] If leap seconds go away, should TZif leap-second tables expire?

Paul Eggert eggert at cs.ucla.edu
Wed Nov 29 23:02:50 UTC 2023

On 11/29/23 14:07, Robert Elz wrote:

> anything which fails to convert (as accurately as is
> believed possible) any time_t which can be represented in a struct tm
> wouldn't be POSIX conformant.

Such an implementation would conform to current POSIX, because the only 
way to get the failing behavior is with a TZ setting like 
TZ='/name/of/truncated/TZ/file' that is not POSIX-conforming, and with 
such a TZ setting the implementation can do what it likes.

POSIX 202x/D3 tightens this up, though, as it requires support for 
geographical and special timezones like TZ='Europe/London'. The details 
of this are a bit hazy, unfortunately, and I suppose an implementer 
determined to make localtime fail on timestamps outside a truncated TZif 
file's range might be able to argue that POSIX allows that.

Anyway as a practical matter I agree with you. Regardless of what POSIX 
says, having localtime fail merely because a TZif file is truncated 
would break so many applications that it's not a plausible implementation.

More information about the tz mailing list