Skip to content

Commit

Permalink
tz (ticdc): fix timezone error (pingcap#3887)
Browse files Browse the repository at this point in the history
  • Loading branch information
asddongmen authored and zhaoxinyu committed Dec 29, 2021
1 parent 575e618 commit 2eadcf8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/util/tz.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}

0 comments on commit 2eadcf8

Please sign in to comment.