1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 23:10:49 +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:
onealtang 2015-09-02 15:50:40 +08:00
parent a89f14d80d
commit adca455804

View File

@ -352,7 +352,7 @@ func ParseForm(form url.Values, obj interface{}) error {
if len(tags) > 1 {
format = tags[1]
}
t, err := time.Parse(format, value)
t, err := time.ParseInLocation(format, value, time.Local)
if err != nil {
return err
}