Commit 2699da18 authored by Alex Brainman's avatar Alex Brainman Committed by Brad Fitzpatrick

time: set Local.name on windows

Local.String() returns "Local" on every OS, but windows.
Change windows code to do like others.

Updates #15568

Change-Id: I7a4d2713d940e2a01cff9d7f5cefc89def07546a
Reviewed-on: https://go-review.googlesource.com/23078Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 5f833121
......@@ -61,3 +61,12 @@ func TestFirstZone(t *testing.T) {
}
}
}
func TestLocationNames(t *testing.T) {
if time.Local.String() != "Local" {
t.Errorf(`invalid Local location name: got %q want "Local"`, time.Local)
}
if time.UTC.String() != "UTC" {
t.Errorf(`invalid UTC location name: got %q want "UTC"`, time.UTC)
}
}
......@@ -140,6 +140,8 @@ func pseudoUnix(year int, d *syscall.Systemtime) int64 {
func initLocalFromTZI(i *syscall.Timezoneinformation) {
l := &localLoc
l.name = "Local"
nzone := 1
if i.StandardDate.Month > 0 {
nzone++
......
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