From b64f7f0e51e127ae6b82a9f5187b2071b3f30635 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Mon, 20 Dec 2021 12:29:46 +0800 Subject: [PATCH] tz (ticdc): fix timezone error (#3887) (#3909) --- pkg/util/tz.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/util/tz.go b/pkg/util/tz.go index 726c08ee7e5..77d03e17306 100644 --- a/pkg/util/tz.go +++ b/pkg/util/tz.go @@ -14,11 +14,11 @@ package util import ( - "os" "path/filepath" "strings" "time" + "github.com/pingcap/tidb/util/timeutil" cerror "github.com/pingcap/tiflow/pkg/errors" ) @@ -57,9 +57,6 @@ func GetLocalTimezone() (*time.Location, error) { if time.Local.String() != "Local" { return time.Local, nil } - str, err := os.Readlink("/etc/localtime") - if err != nil { - return nil, cerror.WrapError(cerror.ErrLoadTimezone, err) - } + str := timeutil.InferSystemTZ() return getTimezoneFromZonefile(str) }