Skip to content

Commit

Permalink
fix(139): fixed time zone (close #5263)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Sep 22, 2023
1 parent 0f03a74 commit a64dd48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/139/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func calSign(body, ts, randStr string) string {
}

func getTime(t string) time.Time {
stamp, _ := time.ParseInLocation("20060102150405", t, time.Local)
stamp, _ := time.ParseInLocation("20060102150405", t, utils.CNLoc)
return stamp
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/utils/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import (
"time"
)

var CNLoc = time.FixedZone("UTC", 8*60*60)

func MustParseCNTime(str string) time.Time {
lastOpTime, _ := time.ParseInLocation("2006-01-02 15:04:05 -07", str+" +08", time.Local)
lastOpTime, _ := time.ParseInLocation("2006-01-02 15:04:05 -07", str+" +08", CNLoc)
return lastOpTime
}

Expand Down

0 comments on commit a64dd48

Please sign in to comment.