From 23a3beaced9b7422ad0199474a32f8774494fdbf Mon Sep 17 00:00:00 2001 From: Nash Tsai Date: Mon, 21 Apr 2014 09:58:12 +0800 Subject: [PATCH] convert to Engine's TZ location for TimeStruct when Get() --- session.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/session.go b/session.go index c8dd787e..ecdaa66f 100644 --- a/session.go +++ b/session.go @@ -1553,7 +1553,11 @@ func (session *Session) row2Bean(rows *core.Rows, fields []string, fieldsCount i t.Minute(), t.Second(), t.Nanosecond(), time.Local) vv = reflect.ValueOf(tt) } + // !nashtsai! convert to engine location + t = vv.Interface().(time.Time).In(session.Engine.TZLocation) + vv = reflect.ValueOf(t) fieldValue.Set(vv) + // t = fieldValue.Interface().(time.Time) // z, _ = t.Zone() // session.Engine.LogDebug("fieldValue key[%v]: %v | zone: %v | location: %+v\n", key, t, z, *t.Location())