You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var gmtLocation = func() *time.Location {
x, err := time.LoadLocation("GMT")
if err != nil {
panic(fmt.Sprintf("cannot load GMT location: %s", err))
}
return x
}()
I think should use UTC timezone
x, err := time.LoadLocation("GMT")
// LoadLocation returns the Location with the given name.
//
// If the name is "" or "UTC", LoadLocation returns UTC.
// If the name is "Local", LoadLocation returns Local.
//
// Otherwise, the name is taken to be a location name corresponding to a file
// in the IANA Time Zone database, such as "America/New_York".
//
// The time zone database needed by LoadLocation may not be
// present on all systems, especially non-Unix systems.
// LoadLocation looks in the directory or uncompressed zip file
// named by the ZONEINFO environment variable, if any, then looks in
// known installation locations on Unix systems,
// and finally looks in $GOROOT/lib/time/zoneinfo.zip.
func LoadLocation(name string) (*Location, error) {
if name == "" || name == "UTC" {
return UTC, nil
}
if name == "Local" {
return Local, nil
}
if zoneinfo != "" {
if z, err := loadZoneFile(zoneinfo, name); err == nil {
z.name = name
return z, nil
}
}
return loadLocation(name)
}
If user not install go sdk, the $GOROOT/lib/time/zoneinfo.zip will not found
The text was updated successfully, but these errors were encountered:
Thanks for the report. At the first sight it looks like UTC may be used here instead of GMT unless http standard disallows this. I'll look closer into this after the weekend.
I think should use UTC timezone
If user not install go sdk, the $GOROOT/lib/time/zoneinfo.zip will not found
The text was updated successfully, but these errors were encountered: