forked from mirror/go-sqlite3
cleanup code
This commit is contained in:
parent
4c5c4e5261
commit
18aa166fa9
21
sqlite3.go
21
sqlite3.go
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue