cleanup code

This commit is contained in:
Yasuhiro Matsumoto 2015-03-04 22:58:32 +09:00
parent 4c5c4e5261
commit 18aa166fa9
1 changed files with 8 additions and 13 deletions

View File

@ -572,19 +572,14 @@ func (rc *SQLiteRows) Next(dest []driver.Value) error {
switch rc.decltype[i] { switch rc.decltype[i] {
case "timestamp", "datetime", "date": case "timestamp", "datetime", "date":
if rc.s.c.loc != nil { zone := rc.s.c.loc
for _, format := range SQLiteTimestampFormats { if zone == nil {
if timeVal, err = time.ParseInLocation(format, s, rc.s.c.loc); err == nil { zone = time.UTC
dest[i] = timeVal }
break for _, format := range SQLiteTimestampFormats {
} if timeVal, err = time.ParseInLocation(format, s, zone); err == nil {
} dest[i] = timeVal
} else { break
for _, format := range SQLiteTimestampFormats {
if timeVal, err = time.ParseInLocation(format, s, time.UTC); err == nil {
dest[i] = timeVal
break
}
} }
} }
if err != nil { if err != nil {