Convert times to UTC before storage

This commit is contained in:
Micah Stetson
2012-12-29 14:47:17 -08:00
parent 58c4612c1e
commit f6d10a2a58
2 changed files with 16 additions and 3 deletions

View File

@@ -213,7 +213,7 @@ func (s *SQLiteStmt) bind(args []driver.Value) error {
}
rv = C._sqlite3_bind_blob(s.s, n, unsafe.Pointer(p), C.int(len(v)))
case time.Time:
b := []byte(v.Format(SQLiteTimestampFormat))
b := []byte(v.UTC().Format(SQLiteTimestampFormat))
rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&b[0])), C.int(len(b)))
}
if rv != C.SQLITE_OK {