diff options
author | mattn <mattn.jp@gmail.com> | 2012-11-04 16:06:42 -0800 |
---|---|---|
committer | mattn <mattn.jp@gmail.com> | 2012-11-04 16:06:42 -0800 |
commit | 68952ca0661526d253d3a9e7551d0612b357bd2b (patch) | |
tree | 46a47f5d8f6be8abf441663320ce7cec96a8730b /sqlite3.go | |
parent | Merge pull request #26 from cookieo9/noexample (diff) | |
parent | Add support for extracting 2006-01-02 formatted timestamps. (diff) | |
download | golite-68952ca0661526d253d3a9e7551d0612b357bd2b.tar.gz golite-68952ca0661526d253d3a9e7551d0612b357bd2b.tar.xz |
Merge pull request #28 from lye/master
Add support for extracting 2006-01-02 formatted timestamps.
Diffstat (limited to 'sqlite3.go')
-rw-r--r-- | sqlite3.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -27,6 +27,7 @@ import ( ) const SQLiteTimestampFormat = "2006-01-02 15:04:05" +const SQLiteDateFormat = "2006-01-02" func init() { sql.Register("sqlite3", &SQLiteDriver{}) @@ -313,7 +314,10 @@ func (rc *SQLiteRows) Next(dest []driver.Value) error { if rc.decltype[i] == "timestamp" { dest[i], err = time.Parse(SQLiteTimestampFormat, s) if err != nil { - return err + dest[i], err = time.Parse(SQLiteDateFormat, s) + if err != nil { + return err + } } } else { dest[i] = s |