Skip to content

Commit ce03cd6

Browse files
ianlancetaylorgopherbot
authored andcommitted
internal/modindex: parse changed time in local time zone
The os package will return ModTime values in the local time zone. We have to parse the time stamp in the local time zone so that comparisons are done correctly. Fixes golang/go#69893 Fixes golang/go#69894 Change-Id: I93631cdc64dda8fdfcdf668e10e0ec939ef1461d Reviewed-on: https://go-review.googlesource.com/c/tools/+/624615 Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Commit-Queue: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Peter Weinberger <pjw@google.com>
1 parent 386503d commit ce03cd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/modindex/index.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func readIndexFrom(cd Abspath, bx io.Reader) (*Index, error) {
145145
}
146146
// TODO(pjw): need to check that this is the expected cachedir
147147
// so the tag should be passed in to this function
148-
ans.Changed, err = time.Parse(time.DateTime, b.Text())
148+
ans.Changed, err = time.ParseInLocation(time.DateTime, b.Text(), time.Local)
149149
if err != nil {
150150
return nil, err
151151
}

0 commit comments

Comments
 (0)