From 7e40bdd83f4fc1f60c782f04ff5302c1d9f59e90 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Tue, 12 Oct 2021 20:46:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/timezone.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/nodes/timezone.go b/internal/nodes/timezone.go index 449a9eb..a8c5ad4 100644 --- a/internal/nodes/timezone.go +++ b/internal/nodes/timezone.go @@ -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