Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
cd269b0c
Commit
cd269b0c
authored
Sep 13, 2011
by
Alex Brainman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
time: another attempt to fix windows build
R=bradfitz CC=golang-dev
https://golang.org/cl/4967067
parent
29d5d9a5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
src/pkg/time/zoneinfo_windows.go
src/pkg/time/zoneinfo_windows.go
+18
-3
No files found.
src/pkg/time/zoneinfo_windows.go
View file @
cd269b0c
...
@@ -70,7 +70,15 @@ func (z *zone) populate(bias, biasdelta int32, d *syscall.Systemtime, name []uin
...
@@ -70,7 +70,15 @@ 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
,
""
})
.
Seconds
()
t
:=
&
Time
{
Year
:
z
.
year
,
Month
:
int
(
z
.
month
),
Day
:
int
(
z
.
day
),
Hour
:
int
(
z
.
hour
),
Minute
:
int
(
z
.
minute
),
Second
:
int
(
z
.
second
),
}
z
.
abssec
=
t
.
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,9 +91,16 @@ func (z *zone) cutoffSeconds(year int64) int64 {
...
@@ -83,9 +91,16 @@ 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
,
""
}
t
:=
&
Time
{
Year
:
year
,
Month
:
int
(
z
.
month
),
Day
:
1
,
Hour
:
int
(
z
.
hour
),
Minute
:
int
(
z
.
minute
),
Second
:
int
(
z
.
second
),
}
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
{
i
+=
7
i
+=
7
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment