From dcf63e09caa0d845ffdc6343bbc0254acd913be2 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 10 Jul 2021 18:25:59 +0800 Subject: [PATCH] Fix time --- convert/time.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/convert/time.go b/convert/time.go index 8901279b..9a2ed6e9 100644 --- a/convert/time.go +++ b/convert/time.go @@ -25,6 +25,13 @@ func String2Time(s string, originalLocation *time.Location, convertedLocation *t } dt = dt.In(convertedLocation) return &dt, nil + } else if len(s) == 25 && s[10] == 'T' && s[19] == '+' && s[22] == ':' { + dt, err := time.Parse("2006-01-02T15:04:05+07:00", s) + if err != nil { + return nil, err + } + dt = dt.In(convertedLocation) + return &dt, nil } return nil, fmt.Errorf("unsupported convertion from %s to time", s) }