Apply the given location instead of engine.location (#435)

This commit is contained in:
Shintaro Kaneko 2017-01-25 20:48:19 +09:00 committed by Lunny Xiao
parent 0b209de773
commit 71190ff044
1 changed files with 2 additions and 0 deletions

View File

@ -1599,6 +1599,8 @@ func (engine *Engine) formatTime(tz *time.Location, sqlTypeName string, t time.T
return t return t
} }
if tz != nil { if tz != nil {
t = t.In(tz)
} else {
t = engine.TZTime(t) t = engine.TZTime(t)
} }
switch sqlTypeName { switch sqlTypeName {