Skip to content

Commit

Permalink
use ParseInLocation with UTC zone
Browse files Browse the repository at this point in the history
  • Loading branch information
glebarez committed Sep 30, 2022
1 parent 1c1b0a7 commit a943536
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func (c *conn) parseTime(s string) (interface{}, bool) {
ts := strings.TrimSuffix(s, "Z")

for _, f := range parseTimeFormats {
t, err := time.Parse(f, ts)
t, err := time.ParseInLocation(f, ts, time.UTC)
if err == nil {
return t, true
}
Expand Down Expand Up @@ -482,7 +482,6 @@ func (s *stmt) Close() (err error) {

// Exec executes a query that doesn't return rows, such as an INSERT or UPDATE.
//
//
// Deprecated: Drivers should implement StmtExecContext instead (or
// additionally).
func (s *stmt) Exec(args []driver.Value) (driver.Result, error) { //TODO StmtExecContext
Expand Down Expand Up @@ -1218,11 +1217,13 @@ func (c *conn) finalize(pstmt uintptr) error {
}

// int sqlite3_prepare_v2(
// sqlite3 *db, /* Database handle */
// const char *zSql, /* SQL statement, UTF-8 encoded */
// int nByte, /* Maximum length of zSql in bytes. */
// sqlite3_stmt **ppStmt, /* OUT: Statement handle */
// const char **pzTail /* OUT: Pointer to unused portion of zSql */
//
// sqlite3 *db, /* Database handle */
// const char *zSql, /* SQL statement, UTF-8 encoded */
// int nByte, /* Maximum length of zSql in bytes. */
// sqlite3_stmt **ppStmt, /* OUT: Statement handle */
// const char **pzTail /* OUT: Pointer to unused portion of zSql */
//
// );
func (c *conn) prepareV2(zSQL *uintptr) (pstmt uintptr, err error) {
var ppstmt, pptail uintptr
Expand Down Expand Up @@ -1277,10 +1278,12 @@ func (c *conn) extendedResultCodes(on bool) error {
}

// int sqlite3_open_v2(
// const char *filename, /* Database filename (UTF-8) */
// sqlite3 **ppDb, /* OUT: SQLite db handle */
// int flags, /* Flags */
// const char *zVfs /* Name of VFS module to use */
//
// const char *filename, /* Database filename (UTF-8) */
// sqlite3 **ppDb, /* OUT: SQLite db handle */
// int flags, /* Flags */
// const char *zVfs /* Name of VFS module to use */
//
// );
func (c *conn) openV2(name string, flags int32) (uintptr, error) {
var p, s uintptr
Expand Down

0 comments on commit a943536

Please sign in to comment.