Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
97197a62
Commit
97197a62
authored
Nov 30, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
time: fix windows build
TBR=brainman CC=golang-dev
https://golang.org/cl/5447057
parent
06e635e4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
zoneinfo_windows.go
src/pkg/time/zoneinfo_windows.go
+9
-6
No files found.
src/pkg/time/zoneinfo_windows.go
View file @
97197a62
...
...
@@ -28,12 +28,10 @@ func abbrev(name []uint16) string {
//
// http://social.msdn.microsoft.com/Forums/eu/vclanguage/thread/a87e1d25-fb71-4fe0-ae9c-a9578c9753eb
// http://stackoverflow.com/questions/4195948/windows-time-zone-abbreviations-in-asp-net
short
:=
make
([]
rune
,
len
(
name
))
w
:=
0
var
short
[]
rune
for
_
,
c
:=
range
name
{
if
'A'
<=
c
&&
c
<=
'Z'
{
short
[
w
]
=
rune
(
c
)
w
++
short
=
append
(
short
,
rune
(
c
))
}
}
return
string
(
short
)
...
...
@@ -78,18 +76,23 @@ func initLocalFromTZI(i *syscall.Timezoneinformation) {
std
:=
&
l
.
zone
[
0
]
std
.
name
=
abbrev
(
i
.
StandardName
[
0
:
])
std
.
offset
=
-
int
(
i
.
StandardBias
)
*
60
if
nzone
==
1
{
// No daylight savings.
std
.
offset
=
-
int
(
i
.
Bias
)
*
60
l
.
cacheStart
=
-
1
<<
63
l
.
cacheEnd
=
1
<<
63
-
1
l
.
cacheZone
=
std
return
}
// StandardBias must be ignored if StandardDate is not set,
// so this computation is delayed until after the nzone==1
// return above.
std
.
offset
=
-
int
(
i
.
Bias
+
i
.
StandardBias
)
*
60
dst
:=
&
l
.
zone
[
1
]
dst
.
name
=
abbrev
(
i
.
DaylightName
[
0
:
])
dst
.
offset
=
std
.
offset
+
-
int
(
i
.
DaylightBias
)
*
60
dst
.
offset
=
-
int
(
i
.
Bias
+
i
.
DaylightBias
)
*
60
dst
.
isDST
=
true
// Arrange so that d0 is first transition date, d1 second,
...
...
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