1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-20 02:20:40 +00:00

Merge pull request from xfwduke/develop

fix bugs of ParseForm about time in RFC3339 format
This commit is contained in:
astaxie
2019-06-18 12:08:55 +08:00
committed by GitHub

@ -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]