From 649c5c861db6fc7a08b40628226ade275da66dbb Mon Sep 17 00:00:00 2001 From: oberontang Date: Fri, 31 May 2019 15:47:21 +0800 Subject: [PATCH] fix bugs of ParseForm about time in RFC3339 format --- templatefunc.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templatefunc.go b/templatefunc.go index d62442ae..ba1ec5eb 100644 --- a/templatefunc.go +++ b/templatefunc.go @@ -361,6 +361,8 @@ func parseFormToStruct(form url.Values, objT reflect.Type, objV reflect.Value) e if len(value) >= 25 { value = value[:25] t, err = time.ParseInLocation(time.RFC3339, value, time.Local) + } else if strings.HasSuffix(strings.ToUpper(value), "Z") { + t, err = time.ParseInLocation(time.RFC3339, value, time.Local) } else if len(value) >= 19 { if strings.Contains(value, "T") { value = value[:19]