优化代码

This commit is contained in:
刘祥超
2021-10-12 20:46:45 +08:00
parent f0d0a39a03
commit 537138c8a1

View File

@@ -19,12 +19,13 @@ func init() {
timeZone = "Asia/Shanghai"
}
location, err := time.LoadLocation(sharedNodeConfig.TimeZone)
if err != nil {
remotelogs.Error("TIMEZONE", "change time zone failed: "+err.Error())
return
}
if lastTimeZone != timeZone {
location, err := time.LoadLocation(timeZone)
if err != nil {
remotelogs.Error("TIMEZONE", "change time zone failed: "+err.Error())
return
}
remotelogs.Println("TIMEZONE", "change time zone to '"+timeZone+"'")
time.Local = location
lastTimeZone = timeZone