Source File
zoneinfo_unix.go
Belonging Package
time
package time
import (
)
var zoneSources = []string{
"/usr/share/zoneinfo/",
"/usr/share/lib/zoneinfo/",
"/usr/lib/locale/TZ/",
runtime.GOROOT() + "/lib/time/zoneinfo.zip",
}
, := syscall.Getenv("TZ")
switch {
case !:
, := loadLocation("localtime", []string{"/etc"})
if == nil {
localLoc = *
localLoc.name = "Local"
return
}
case != "":
if [0] == ':' {
= [1:]
}
if != "" && [0] == '/' {
if , := loadLocation(, []string{""}); == nil {
localLoc = *
if == "/etc/localtime" {
localLoc.name = "Local"
} else {
localLoc.name =
}
return
}
} else if != "" && != "UTC" {
if , := loadLocation(, zoneSources); == nil {
localLoc = *
return
}
}
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |