From 251c3ff0282168c8cc44c48d27916b02e3498a7f Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期五, 11 八月 2023 15:01:04 +0800 Subject: [PATCH] fix --- api/v1/followRecord.go | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/api/v1/followRecord.go b/api/v1/followRecord.go index e015177..fef5098 100644 --- a/api/v1/followRecord.go +++ b/api/v1/followRecord.go @@ -172,27 +172,25 @@ // checkTimeFormat // 妫�鏌ユ椂闂存牸寮� -func checkTimeFormat(t string) (time.Time, error) { - if t == "" { - t = "1900-01-01T00:00:00+08:00" - } - +func checkTimeFormat(t string) (*time.Time, error) { location, err := time.LoadLocation("Asia/Shanghai") if err != nil { - return time.Time{}, err + return nil, err } tt, err := time.Parse("2006-01-02T15:04:05.000Z", t) if err == nil { - return tt.In(location), nil + ret := tt.In(location) + return &ret, nil } tt, err = time.Parse("2006-01-02T15:04:05-07:00", t) if err == nil { - return tt.In(location), nil + ret := tt.In(location) + return &ret, nil } - return time.Time{}, err + return nil, err } // List -- Gitblit v1.8.0