Browse Source

time bug fix

xormplus 8 years ago
parent
commit
90c8a83ed6
1 changed files with 3 additions and 0 deletions
  1. 3 0
      engine.go

+ 3 - 0
engine.go

@@ -1555,6 +1555,9 @@ func (engine *Engine) formatTime(sqlTypeName string, t time.Time) (v interface{}
 		v = t.Format("2006-01-02")
 	case core.DateTime, core.TimeStamp:
 		v = t.Format("2006-01-02 15:04:05.999")
+		if engine.dialect.DBType() == "sqlite3" {
+			v = t.UTC().Format("2006-01-02 15:04:05.999")
+		}
 	case core.TimeStampz:
 		if engine.dialect.DBType() == core.MSSQL {
 			v = t.Format("2006-01-02T15:04:05.9999999Z07:00")