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
597 stars 166 forks source link

Extend transitions for 401 years #268

Closed devbww closed 1 year ago

devbww commented 1 year ago

2022g introduced a new zone, America/Ciudad_Juarez, whose "-b slim" form ends in 2022, but with transitions that do not match those that would be generated by the POSIX TZ string used to handle instants in future years.

If we extend the transitions for only 400 years, instants beyond the last generated transition in years equivalent to (2022 mod 400), will be mapped back to 2022, where they could therefore be given the wrong treatment.

So, extend the transitions using the POSIX string for 401 years instead. This means we will always map back to a generated year (in this case, 2023 to 2422).