google / cctz

CCTZ is a C++ library for translating between absolute and civil times using the rules of a time zone.
Apache License 2.0
596 stars 166 forks source link

Start using the "backzone" file when building the testdata. #227

Closed devbww closed 2 years ago

devbww commented 2 years ago

The upstream penchant to coalesce zones that have not differed since 1970 has gotten out of hand. So, become a "PACKRAT" and start using the "backzone" file, which (supposedly) preserves the distinct pre-1970 history for those zones.

This reverts the undesirable testdata/zoneinfo changes we picked up during the update to 2022b. And, we no longer need to allow for using the "global-tz" version of the tzdata, which had the same goal of preserving the pre-1970 rules.

However, it also means we are now exposed to certain rules that are only present in "backzone". In particular, Africa/Freetown, which used to be a link to Africa/Abidjan, now has a future rule of "XXX-0:40<+01>-0:20,0/0,J365/23:40", which is an obfuscated way to say it has year-round daylight time, at +00:20.

TimeZoneInfo::ExtendTransitions() would previously have been confused by such a rule, and generated zero-length transitions, which would then break the lookup code. Now, we recognized this as a year-round rule (just like year-round standard time), and do not generate any yearly transitions.

Finally, add "Europe/Kyiv" (from 2022b) and "Factory" to the list(s) of known zone names.


This change is Reviewable