1
0
mirror of https://github.com/golang/go synced 2024-11-17 15:04:45 -07:00

time: use yday

This commit is contained in:
Shuo 2020-03-01 10:31:34 +08:00 committed by GitHub
parent 0902b6f4f7
commit a376c57e83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -553,8 +553,8 @@ func (t Time) ISOWeek() (year, week int) {
}
// find the Thursday of the calendar week
abs += uint64(d) * secondsPerDay
year, _, _, week = absDate(abs, false)
return year, week/7 + 1
year, _, _, yday := absDate(abs, false)
return year, yday/7 + 1
}
// Clock returns the hour, minute, and second within the day specified by t.