commit | f12cf7694f491a13bb39741d183034a917a994b3 | [log] [tgz] |
---|---|---|
author | Ian Lance Taylor <iant@golang.org> | Mon Apr 05 12:10:21 2021 -0700 |
committer | Ian Lance Taylor <iant@golang.org> | Mon Apr 12 21:25:46 2021 +0000 |
tree | 9b84fe9c6d5ce8abda5ae5815c53dc399ed84fc3 | |
parent | 9baddd3f21230c55f0ad2a10f5f20579dcf0a0bb [diff] |
[release-branch.go1.16] time: use offset and isDST when caching zone 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>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://golang.org/doc/contribute.html.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.