time bug fix

This commit is contained in:
WhiteBatman 2017-09-23 20:50:11 +08:00
parent 1880ee2b96
commit 5017cabec6
1 changed files with 3 additions and 10 deletions

View File

@ -1545,17 +1545,10 @@ func (engine *Engine) formatTime(sqlTypeName string, t time.Time) (v interface{}
case core.Date:
v = t.Format("2006-01-02")
case core.DateTime, core.TimeStamp:
<<<<<<< HEAD
v = t.Format("2006-01-02 15:04:05")
=======
if engine.dialect.DBType() == "ql" {
v = t
} else if engine.dialect.DBType() == "sqlite3" {
v = t.UTC().Format("2006-01-02 15:04:05")
} else {
v = t.Format("2006-01-02 15:04:05.999")
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")
}
>>>>>>> 8c9ffa956bec4149aa6f6961ab1afe93ff93b2eb
case core.TimeStampz:
if engine.dialect.DBType() == core.MSSQL {
v = t.Format("2006-01-02T15:04:05.9999999Z07:00")