mirror of
https://github.com/golang/go
synced 2024-11-26 22:51:23 -07:00
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/23078 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
5f833121cb
commit
2699da1809
@ -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++
|
||||
|
Loading…
Reference in New Issue
Block a user