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) }