diff options
author | mattn <mattn.jp@gmail.com> | 2017-07-01 20:48:21 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-01 20:48:21 +0900 |
commit | 8a4c825cfc99b620bd78dbeac30348782a3b3eb9 (patch) | |
tree | ecca0bc608fe592ac2007e6cb180c71a1375b558 /sqlite3.go | |
parent | Merge pull request #429 from emakeev/cgo_panic_fix (diff) | |
parent | Don't convert Unix times to nanoseconds when querying datetime fields. Fixes ... (diff) | |
download | golite-8a4c825cfc99b620bd78dbeac30348782a3b3eb9.tar.gz golite-8a4c825cfc99b620bd78dbeac30348782a3b3eb9.tar.xz |
Merge pull request #431 from deepilla/issue-430
Don't convert Unix times to nanoseconds when querying datetime fields…
Diffstat (limited to 'sqlite3.go')
-rw-r--r-- | sqlite3.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -961,10 +961,11 @@ func (rc *SQLiteRows) Next(dest []driver.Value) error { // large to be a reasonable timestamp in seconds. if val > 1e12 || val < -1e12 { val *= int64(time.Millisecond) // convert ms to nsec + t = time.Unix(0, val) } else { - val *= int64(time.Second) // convert sec to nsec + t = time.Unix(val, 0) } - t = time.Unix(0, val).UTC() + t = t.UTC() if rc.s.c.loc != nil { t = t.In(rc.s.c.loc) } |