Skip to content

Commit

Permalink
tz (ticdc): fix timezone error
Browse files Browse the repository at this point in the history
  • Loading branch information
asddongmen authored and ti-chi-bot committed Dec 16, 2021
1 parent 0c853a6 commit 2639f17
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 2639f17

Please sign in to comment.