diff --git a/pkg/util/tz.go b/pkg/util/tz.go index 632e9810860..b1e18043542 100644 --- a/pkg/util/tz.go +++ b/pkg/util/tz.go @@ -14,12 +14,12 @@ package util import ( - "os" "path/filepath" "strings" "time" cerror "github.com/pingcap/ticdc/pkg/errors" + "github.com/pingcap/tidb/util/timeutil" ) // GetTimezone returns the timezone specified by the name @@ -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) }