[tz] POSIX-TZ-environment-variable-style string rules

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Jul 28 15:17:15 UTC 2016


On Thu, Jul 28, 2016 at 1:23 AM, Paul Eggert <eggert at cs.ucla.edu> wrote:
>>
>> I think a better solution would be to make zic add a redundant transition
>> when the local time type corresponding to the last transition does not
>> match the POSIX rule.
>
>
> ... How about a belt-and-suspenders approach? That is, add the redundant
transition, but also fix localtime.c to implement the documented behavior.


I am not sure I would go that far.  Note that the glibc behavior on the
current Africa/Casablanca tzfile is puzzling: the 2037-10-04 transition
does not show in the zdump output even though it is present in the tzfile.
Furthermore, there are projects other than tzcode that implement tzcode
behavior for example Ruby's TZInfo::Data project decided [1] that they
would follow tzcode logic.

I think the best way forward would be to document the fact that a tzfile
with the last explicit transition not matching a POSIX rule transition is
invalid and the behavior of localtime with such file is undefined.

I suggest fixing the issue in two steps:

1. Add 2038-03-28 transition to the Morocco rules in the raw africa file.
2. Modify zic to warn about raw files where the last explicit transition
does not match the rule from the POSIX string and add an appropriate
transition in the binary file.

Note that the first step will be sufficient to fix the current issue while
the second step will prevent a similar issue from occurring in the future.


[1] https://github.com/tzinfo/tzinfo-data/issues/10
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mm.icann.org/pipermail/tz/attachments/20160728/47d6df83/attachment.htm>


More information about the tz mailing list