lau / tzdata

tzdata for Elixir. Born from the Calendar library.
MIT License
303 stars 71 forks source link

IANA data does not seem to be correctly parsed for America/Whitehorse (Canada/Yukon) and America/Dawson #102

Closed jarrodmoldrich closed 2 years ago

jarrodmoldrich commented 4 years ago

HI @lau,

I was searching through Tzdata.periods() for any records that had two time zone changes in a short period of time, and I came across a few overlapping periods that looked like this:

  %{
    from: %{standard: 63750855600, utc: 63750880800, wall: 63750855600},
    std_off: 0,
    until: %{standard: :max, utc: :max, wall: :max},
    utc_off: -25200,
    zone_abbr: "MST"
  },
  %{
    from: %{standard: 63750852000, utc: 63750880800, wall: 63750855600},
    std_off: 3600,
    until: %{standard: 63771411600, utc: 63771440400, wall: 63771415200},
    utc_off: -28800,
    zone_abbr: "PDT"
  }

... and confirming this is the latest data:

iex(5)> Tzdata.tzdata_version()
"2020a"

It appears that this year the Yukon region decided against moving back to PST from March 8th, but instead remain on PDT. The IANA decided to call this new time MST, in line with adjacent cities that have made a similar determination. The IANA data for 2020a is below:

Zone America/Whitehorse -9:00:12 -  LMT 1900 Aug 20
            -9:00   NT_YK   Y%sT    1967 May 28  0:00
            -8:00   NT_YK   P%sT    1980
            -8:00   Canada  P%sT    2020 Mar  8  2:00
            -7:00   -   MST
Zone America/Dawson -9:17:40 -  LMT 1900 Aug 20
            -9:00   NT_YK   Y%sT    1973 Oct 28  0:00
            -8:00   NT_YK   P%sT    1980
            -8:00   Canada  P%sT    2020 Mar  8  2:00
            -7:00   -   MST

... and here are the relevant discussions:

"[tz] Yukon to move to year-round PDT" https://mm.icann.org/pipermail/tz/2020-March/thread.html

Judging by the IANA data, PST should have ended on 2020 Mar 8 under Canada rules and then move to MST from then onwards.

Keen to hear your thoughts.

Cheers,

Jarrod

lau commented 4 years ago

Hi Jarrod

Thank you for the report. That does look like a bug.

-- Lau

jarrodmoldrich commented 4 years ago

Thanks Lau. If you're time-limited, I could find some time to track it down and make a patch. Just let me know. Otherwise, thank you for your efforts.

lau commented 4 years ago

Hi Jarrod. Sure, if you want to spend some time to track it down that would be appreciated.

jarrodmoldrich commented 4 years ago

No worries, @lau . In the middle of something, but I'll set aside some time this month to look at it.

jarrodmoldrich commented 2 years ago

The fix/period_overlaps PR merge fixes this and any other issues by ensuring that time zone periods are contiguous and do not overlap.