1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 12:50:55 +00:00

Support time.RFC3339

Signed-off-by: Guohua Ouyang <guohuaouyang@gmail.com>
This commit is contained in:
Guohua Ouyang 2017-03-25 07:52:43 +08:00
parent 49fffe3ebe
commit 83d4385f1f

View File

@ -362,7 +362,10 @@ func parseFormToStruct(form url.Values, objT reflect.Type, objV reflect.Value) e
t time.Time
err error
)
if len(value) >= 19 {
if len(value) >= 25 {
value = value[:25]
t, err = time.ParseInLocation(time.RFC3339, value, time.Local)
} else if len(value) >= 19 {
value = value[:19]
t, err = time.ParseInLocation(formatDateTime, value, time.Local)
} else if len(value) >= 10 {