Skip to content

Commit 54b2015

Browse files
committed
time: fix timezone lookup logic for non-DST zones
Fixes golang#58682
1 parent ddb423a commit 54b2015

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/time/zoneinfo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func (l *Location) lookup(sec int64) (name string, offset int, start, end int64,
203203
// If we're at the end of the known zone transitions,
204204
// try the extend string.
205205
if lo == len(tx)-1 && l.extend != "" {
206-
if ename, eoffset, estart, eend, eisDST, ok := tzset(l.extend, end, sec); ok {
206+
if ename, eoffset, estart, eend, eisDST, ok := tzset(l.extend, start, sec); ok {
207207
return ename, eoffset, estart, eend, eisDST
208208
}
209209
}

src/time/zoneinfo_read.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func LoadLocationFromTZData(name string, data []byte) (*Location, error) {
329329
} else if l.extend != "" {
330330
// If we're at the end of the known zone transitions,
331331
// try the extend string.
332-
if name, offset, estart, eend, isDST, ok := tzset(l.extend, l.cacheEnd, sec); ok {
332+
if name, offset, estart, eend, isDST, ok := tzset(l.extend, l.cacheStart, sec); ok {
333333
l.cacheStart = estart
334334
l.cacheEnd = eend
335335
// Find the zone that is returned by tzset to avoid allocation if possible.

0 commit comments

Comments
 (0)