Skip to content

Commit bbd4389

Browse files
authored
fix(wopan): use fixed timezone for parsing time (#1170)
fix(wopan): update getTime function to use fixed timezone for parsing Signed-off-by: MadDogOwner <[email protected]>
1 parent f350ccd commit bbd4389

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/wopan/util.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ func (d *Wopan) getSpaceType() string {
3636

3737
// 20230607214351
3838
func getTime(str string) (time.Time, error) {
39-
return time.Parse("20060102150405", str)
39+
loc := time.FixedZone("UTC+8", 8*60*60)
40+
return time.ParseInLocation("20060102150405", str, loc)
4041
}

0 commit comments

Comments
 (0)