From 1f223168ee1bdfca15f6732db80ab74e8fa97e0d Mon Sep 17 00:00:00 2001 From: Linquize Date: Sat, 6 Feb 2016 17:28:22 +0800 Subject: [PATCH] mssql: Insert DateTime/Timestamp as UTC time string --- engine.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine.go b/engine.go index afb38766..fd6cdf07 100644 --- a/engine.go +++ b/engine.go @@ -1470,6 +1470,8 @@ func (engine *Engine) formatTime(tz *time.Location, sqlTypeName string, t time.T v = t } else if engine.dialect.DBType() == "sqlite3" { v = t.UTC().Format("2006-01-02 15:04:05") + } else if engine.dialect.DBType() == core.MSSQL { + v = engine.TZTime(t).UTC().Format("2006-01-02 15:04:05") } else { v = t.Format("2006-01-02 15:04:05") }