mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 21:21:29 +00:00
always use server's locale to parse date
When parsing the date without time, it's always using UTC date, which is unexpected. If we want to use UTC date, it's recommend to set the server's timezone as UTC, and keep the code flexible.
This commit is contained in:
parent
a89f14d80d
commit
adca455804
@ -352,7 +352,7 @@ func ParseForm(form url.Values, obj interface{}) error {
|
|||||||
if len(tags) > 1 {
|
if len(tags) > 1 {
|
||||||
format = tags[1]
|
format = tags[1]
|
||||||
}
|
}
|
||||||
t, err := time.Parse(format, value)
|
t, err := time.ParseInLocation(format, value, time.Local)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user