-
Notifications
You must be signed in to change notification settings - Fork 18k
time: LoadLocationFromTZData with slim tzdata uses incorrect zone #44385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Some of the listed time zones are duplicates. |
Thanks for finding these cases. Sending a fix. |
Change https://golang.org/cl/296392 mentions this issue: |
@ianlancetaylor Thanks! Should this be considered for a 1.16 patch release since it affects |
@gopherbot Please open backport issues. We mishandle a couple of cases in the time extension strings used by the slim tzdata format. The slim format is likely to appear on more and more systems going forward, and is what we use when people use the time/tzdata package. |
Backport issue(s) opened: #44617 (for 1.15), #44618 (for 1.16). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/297229 mentions this issue: |
Change https://golang.org/cl/297230 mentions this issue: |
This fixes two uncommon cases. First, the tzdata code permits timezone offsets up to 24 * 7, although the POSIX TZ parsing does not. The tzdata code uses this to specify a day of week in some cases. Second, we incorrectly rejected a negative time offset for when a time zone change comes into effect. For #44385 Fixes #44618 Change-Id: I5f2efc1d385e9bfa974a0de3fa81e7a94b827602 Reviewed-on: https://go-review.googlesource.com/c/go/+/296392 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> (cherry picked from commit d9fd38e) Reviewed-on: https://go-review.googlesource.com/c/go/+/297230
This fixes two uncommon cases. First, the tzdata code permits timezone offsets up to 24 * 7, although the POSIX TZ parsing does not. The tzdata code uses this to specify a day of week in some cases. Second, we incorrectly rejected a negative time offset for when a time zone change comes into effect. For #44385 Fixes #44617 Change-Id: I5f2efc1d385e9bfa974a0de3fa81e7a94b827602 Reviewed-on: https://go-review.googlesource.com/c/go/+/296392 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> (cherry picked from commit d9fd38e) Reviewed-on: https://go-review.googlesource.com/c/go/+/297229
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Loaded tzdata with both "fat" and "slim" formats.
What did you expect to see?
Same time zone info regardless of whether using "fat" or "slim" tzdata.
What did you see instead?
Incorrect zones selected when using "slim" tzdata.
Comparing "fat" and "slim" versions of the 2021a tzdata I found 9 discrepancies:
Script used (doesn't work in playground): https://play.golang.org/p/iaduStbpjnU
time/tzdata
is affected in Go 1.16 since it now uses the "slim" format.Related: #42216
The text was updated successfully, but these errors were encountered: