]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.17] time: fix looking for zone offset when date is close to a...
authorzhouguangyuan <zhouguangyuan.xian@gmail.com>
Tue, 2 Nov 2021 15:17:21 +0000 (23:17 +0800)
committerIan Lance Taylor <iant@golang.org>
Mon, 29 Nov 2021 19:46:17 +0000 (19:46 +0000)
commitb7651e504651e1d1a26daf41f9d5ecd1cadc1b81
tree379bcc0e436c5d5d7974eed7f0ab5d3bfbcc42d7
parent4eaf0b7a58d024e7d44f58a26914fb1885fd4dd6
[release-branch.go1.17] time: fix looking for zone offset when date is close to a zone transition

The old implement passed start - 1 or end in func lookup to adjust the offset.But if the time is close to the last zoneTrans, like the issue, testcase and comment, the "start" from lookup will be omega. It can't be adjusted correctly.

Fixes #49407

Change-Id: Ibaf82dc4db6d5dd3279796f003d2b19c38a26341
Reviewed-on: https://go-review.googlesource.com/c/go/+/360616
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Robert Findley <rfindley@google.com>
(cherry picked from commit 90462dfc3aa99649de90bb587af56a9cb0214665)
Reviewed-on: https://go-review.googlesource.com/c/go/+/361955
Trust: Dmitri Shuralyov <dmitshur@golang.org>
src/time/time.go
src/time/time_test.go