diff options
author | Unknwon <u@gogs.io> | 2017-06-07 01:19:32 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-06-07 01:19:32 -0400 |
commit | b40dc550ed15efd2c6faa1ea619888a400499a84 (patch) | |
tree | a5a064eed5e4e913fdbba23f8ab278844655863d /vendor/github.com/go-xorm/xorm/session.go | |
parent | c210984b40a23f20bebe1f905ff6b1297c3ad901 (diff) |
vendor: update github.com/go-xorm/* (#4419)
Diffstat (limited to 'vendor/github.com/go-xorm/xorm/session.go')
-rw-r--r-- | vendor/github.com/go-xorm/xorm/session.go | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/vendor/github.com/go-xorm/xorm/session.go b/vendor/github.com/go-xorm/xorm/session.go index 475c769f..bbe56adc 100644 --- a/vendor/github.com/go-xorm/xorm/session.go +++ b/vendor/github.com/go-xorm/xorm/session.go @@ -344,15 +344,6 @@ func (session *Session) row2Bean(rows *core.Rows, fields []string, fieldsCount i } }() - dbTZ := session.Engine.DatabaseTZ - if dbTZ == nil { - if session.Engine.dialect.DBType() == core.SQLITE { - dbTZ = time.UTC - } else { - dbTZ = time.Local - } - } - var tempMap = make(map[string]int) var pk core.PK for ii, key := range fields { @@ -528,11 +519,9 @@ func (session *Session) row2Bean(rows *core.Rows, fields []string, fieldsCount i } case reflect.Struct: if fieldType.ConvertibleTo(core.TimeType) { - var tz *time.Location - if col.TimeZone == nil { - tz = session.Engine.TZLocation - } else { - tz = col.TimeZone + dbTZ := session.Engine.DatabaseTZ + if col.TimeZone != nil { + dbTZ = col.TimeZone } if rawValueType == core.TimeType { @@ -548,14 +537,13 @@ func (session *Session) row2Bean(rows *core.Rows, fields []string, fieldsCount i t.Minute(), t.Second(), t.Nanosecond(), dbTZ) } - // !nashtsai! convert to engine location - t = t.In(tz) + t = t.In(session.Engine.TZLocation) fieldValue.Set(reflect.ValueOf(t).Convert(fieldType)) } else if rawValueType == core.IntType || rawValueType == core.Int64Type || rawValueType == core.Int32Type { hasAssigned = true - t := time.Unix(vv.Int(), 0).In(tz) + t := time.Unix(vv.Int(), 0).In(session.Engine.TZLocation) fieldValue.Set(reflect.ValueOf(t).Convert(fieldType)) } else { if d, ok := vv.Interface().([]uint8); ok { |