mirror of
https://github.com/golang/go
synced 2024-09-29 00:34:30 -06:00
time: fix Windows build after ceeedb519c4a
R=golang-dev, r CC=golang-dev https://golang.org/cl/4983060
This commit is contained in:
parent
0432a23c68
commit
29d5d9a5bb
@ -70,7 +70,7 @@ func (z *zone) populate(bias, biasdelta int32, d *syscall.Systemtime, name []uin
|
|||||||
// Pre-calculate cutoff time in seconds since the Unix epoch, if data is supplied in "absolute" format.
|
// Pre-calculate cutoff time in seconds since the Unix epoch, if data is supplied in "absolute" format.
|
||||||
func (z *zone) preCalculateAbsSec() {
|
func (z *zone) preCalculateAbsSec() {
|
||||||
if z.year != 0 {
|
if z.year != 0 {
|
||||||
z.abssec = (&Time{z.year, int(z.month), int(z.day), int(z.hour), int(z.minute), int(z.second), 0, 0, 0, ""}).Seconds()
|
z.abssec = (&Time{z.year, int(z.month), int(z.day), int(z.hour), int(z.minute), int(z.second), 0, 0, ""}).Seconds()
|
||||||
// Time given is in "local" time. Adjust it for "utc".
|
// Time given is in "local" time. Adjust it for "utc".
|
||||||
z.abssec -= int64(z.prev.offset)
|
z.abssec -= int64(z.prev.offset)
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ func (z *zone) cutoffSeconds(year int64) int64 {
|
|||||||
// z.dayofweek is appropriate weekday (Sunday=0 to Saturday=6)
|
// z.dayofweek is appropriate weekday (Sunday=0 to Saturday=6)
|
||||||
// z.day is week within the month (1 to 5, where 5 is last week of the month)
|
// z.day is week within the month (1 to 5, where 5 is last week of the month)
|
||||||
// z.hour, z.minute and z.second are absolute time
|
// z.hour, z.minute and z.second are absolute time
|
||||||
t := &Time{year, int(z.month), 1, int(z.hour), int(z.minute), int(z.second), 0, 0, 0, ""}
|
t := &Time{year, int(z.month), 1, int(z.hour), int(z.minute), int(z.second), 0, 0, ""}
|
||||||
t = SecondsToUTC(t.Seconds())
|
t = SecondsToUTC(t.Seconds())
|
||||||
i := int(z.dayofweek) - t.Weekday
|
i := int(z.dayofweek) - t.Weekday
|
||||||
if i < 0 {
|
if i < 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user