mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:30:56 +00:00
Support time.RFC3339
Signed-off-by: Guohua Ouyang <guohuaouyang@gmail.com>
This commit is contained in:
parent
49fffe3ebe
commit
83d4385f1f
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user