-
Notifications
You must be signed in to change notification settings - Fork 18k
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
time: Europe/Dublin timezone handling broken with embedded timezone database #45370
Comments
I have converted the Note that both versions (Go/system one) should be 2021a (the package version in the Docker image is |
In this case the missing zone transitions in the embedded timezone database lead to
This leads to a similar situation as in #36529, because there are two variants of Since a9b3c4b |
Change https://golang.org/cl/307190 mentions this issue: |
@gopherbot Please open a backport issue. This issue will cause incorrect timezone information to be used on systems using the slim tzdata format, which are increasingly likely as it is now the default. |
Backport issue(s) opened: #45384 (for 1.15), #45385 (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. |
For the record, I compared the zone offsets for
|
Change https://golang.org/cl/307212 mentions this issue: |
Change https://golang.org/cl/307211 mentions this issue: |
…from extend string If the current time is computed from extend string and the zone file contains multiple zones with the same name, the lookup by name might find incorrect zone. This happens for example with the slim Europe/Dublin time zone file in the embedded zip. This zone file has last transition in 1996 and rest is covered by extend string. tzset returns IST as the zone name to use, but there are two records with IST name. Lookup by name finds the wrong one. We need to check offset and isDST too. In case we can't find an existing zone, we allocate a new zone so that we use correct offset and isDST. I have renamed zone variable to zones as it shadowed the zone type that we need to allocate the cached zone. Backport note: this change also incorporates portions of CL 264077. For #45370 Fixes #45384 Change-Id: I43d416d009e20878261156c821a5784e2407ed1f Reviewed-on: https://go-review.googlesource.com/c/go/+/307212 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
…from extend string If the current time is computed from extend string and the zone file contains multiple zones with the same name, the lookup by name might find incorrect zone. This happens for example with the slim Europe/Dublin time zone file in the embedded zip. This zone file has last transition in 1996 and rest is covered by extend string. tzset returns IST as the zone name to use, but there are two records with IST name. Lookup by name finds the wrong one. We need to check offset and isDST too. In case we can't find an existing zone, we allocate a new zone so that we use correct offset and isDST. I have renamed zone variable to zones as it shadowed the zone type that we need to allocate the cached zone. Backport note: this change also incorporates portions of CL 264077. For #45370 Fixes #45385 Change-Id: If7a0cccc1908e27f0509bf422d824133133250fc Reviewed-on: https://go-review.googlesource.com/c/go/+/307211 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
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?
When I run the following test program in Go 1.16.3 Docker image:
What did you expect to see?
I expect to see
2021-04-02 11:12:13 +0100 IST
also when using the embedded timezone database.What did you see instead?
2021-04-02 11:12:13 +0034 IST
which has incorrect offset from UTC.The text was updated successfully, but these errors were encountered: