Commit bdf30565 authored by Joe Tsai's avatar Joe Tsai Committed by Joe Tsai

archive/zip: use Time.UTC instead of Time.In(time.UTC)

The former is more succinct and readable.

Change-Id: Ic249d1261a705ad715aeb611c70c7fa91db98254
Reviewed-on: https://go-review.googlesource.com/76830
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 95322a3a
......@@ -391,7 +391,7 @@ parseExtras:
msdosModified := msDosTimeToTime(f.ModifiedDate, f.ModifiedTime)
f.Modified = msdosModified
if !modified.IsZero() {
f.Modified = modified.In(time.UTC)
f.Modified = modified.UTC()
// If legacy MS-DOS timestamps are set, we can use the delta between
// the legacy and extended versions to estimate timezone offset.
......
......@@ -231,7 +231,7 @@ func timeToMsDosTime(t time.Time) (fDate uint16, fTime uint16) {
// Deprecated: Use Modified instead.
func (h *FileHeader) ModTime() time.Time {
if !h.Modified.IsZero() {
return h.Modified.In(time.UTC) // Convert to UTC for compatibility
return h.Modified.UTC() // Convert to UTC for compatibility
}
return msDosTimeToTime(h.ModifiedDate, h.ModifiedTime)
}
......@@ -241,7 +241,7 @@ func (h *FileHeader) ModTime() time.Time {
//
// Deprecated: Use Modified instead.
func (h *FileHeader) SetModTime(t time.Time) {
t = t.In(time.UTC) // Convert to UTC for compatibility
t = t.UTC() // Convert to UTC for compatibility
h.Modified = t
h.ModifiedDate, h.ModifiedTime = timeToMsDosTime(t)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment