Browse Source

grmi date类型unmarshal时指定location为全局timezone location

pull/24/head
zhangxin 4 years ago
parent
commit
483ecf8f68
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      grmi/Date.go

+ 2
- 1
grmi/Date.go View File

@ -1,6 +1,7 @@
package grmi package grmi
import ( import (
"LAPP_GAAS_GFrame_BACKEND/utils"
"encoding/json" "encoding/json"
"fmt" "fmt"
"time" "time"
@ -18,7 +19,7 @@ func (self *Date) UnmarshalJSON(data []byte) error {
if err != nil { if err != nil {
return err return err
} }
result, err := time.Parse(URLDateFormat, jsonString)
result, err := time.ParseInLocation(URLDateFormat, jsonString, utils.TimeZoneLocation)
if err != nil { if err != nil {
return err return err
} }


Loading…
Cancel
Save