From 537138c8a11c224a5617fa991f1c0b371b9cdaae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= 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