mirror of
https://github.com/xiaoqidun/gocos.git
synced 2024-05-03 18:04:15 +08:00
Update gocos.go
feat(时区设置): 默认北京时区
This commit is contained in:
parent
3ef8929f4b
commit
f1dc2b82f9
7
gocos.go
7
gocos.go
|
@ -56,11 +56,8 @@ func VarIsEmpty(a ...interface{}) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
tz := os.Getenv("TZ")
|
var cstZone = time.FixedZone("CST", 8*3600) // 东八
|
||||||
if tz == "" {
|
time.Local = cstZone
|
||||||
tz = "Asia/Shanghai"
|
|
||||||
}
|
|
||||||
time.Local, _ = time.LoadLocation(tz)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user