[tz] Tzdb and the Sunshine Protection Act
Paul Eggert
eggert at cs.ucla.edu
Sat Mar 4 10:03:00 UTC 2023
On 2023-03-03 02:09, Ian Abbott wrote:
> Weren't TZ strings like "EST5EDT" in use by Unix before POSIX made them
> non-standard?
Yes, as I recall System V supported settings like TZ='EST5' and
TZ='EST5EDT'. Time zone abbreviations had to be exactly three letters
long, and there was no way to specify DST rules in the TZ string. I
believe US DST rules were hard-coded in the C library, though I suppose
some enterprising hackers in Europe may have changed the source code and
recompiled everything.
For reasons of backward compatibility tzcode still supports this sort of
thing, though it does not insist on exactly three letters, and it lets
builders more easily alter the compiled-in DST rules by building with
something like this for Europe:
make CFLAGS='-DTZDEFRULESTRING=\",M3.5.0,M10.5.0/3\"'
as noted in the Makefile. This flexibility is a two-edged sword, though,
and I hope that pretty much nobody needs or uses it. Users in France
should use TZ='Europe/Paris', or at worst
TZ='CET-1CEST,M3.5.0,M10.5.0/3'; they should not use a System V style
setting like TZ='CET-1CES' as this will give wrong answers on most
platforms: these platforms assume US DST rules if they assume anything
at all.
More information about the tz
mailing list