1
0
镜像自地址 https://github.com/tuna/tunasync.git 已同步 2025-12-07 06:56:47 +00:00

fix(manager): timezone issue of status test

这个提交包含在:
bigeagle
2016-04-29 07:59:54 +08:00
父节点 42c645a736
当前提交 d1981379a4
共有 2 个文件被更改,包括 4 次插入4 次删除

查看文件

@@ -13,11 +13,11 @@ type textTime struct {
}
func (t textTime) MarshalJSON() ([]byte, error) {
return json.Marshal(t.Format("2006-01-02 15:04:05"))
return json.Marshal(t.Format("2006-01-02 15:04:05 -0700"))
}
func (t *textTime) UnmarshalJSON(b []byte) error {
s := string(b)
t2, err := time.ParseInLocation(`"2006-01-02 15:04:05"`, s, time.Local)
t2, err := time.Parse(`"2006-01-02 15:04:05 -0700"`, s)
*t = textTime{t2}
return err
}