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
1 changed files with 1 additions and 1 deletions

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
}