Fix mssql timezone
Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
ed8e7e426a
commit
26cbce14e0
|
@ -460,6 +460,11 @@ func formatColumnValue(dstDialect dialects.Dialect, d interface{}, col *schemas.
|
||||||
var v = fmt.Sprintf("%s", d)
|
var v = fmt.Sprintf("%s", d)
|
||||||
return "'" + strings.Replace(v, "'", "''", -1) + "'"
|
return "'" + strings.Replace(v, "'", "''", -1) + "'"
|
||||||
} else if col.SQLType.IsTime() {
|
} else if col.SQLType.IsTime() {
|
||||||
|
if dstDialect.URI().DBType == schemas.MSSQL && col.SQLType.Name == schemas.DateTime {
|
||||||
|
if t, ok := d.(time.Time); ok {
|
||||||
|
return "'" + t.UTC().Format("2006-01-02 15:04:05") + "'"
|
||||||
|
}
|
||||||
|
}
|
||||||
var v = fmt.Sprintf("%s", d)
|
var v = fmt.Sprintf("%s", d)
|
||||||
if strings.HasSuffix(v, " +0000 UTC") {
|
if strings.HasSuffix(v, " +0000 UTC") {
|
||||||
return fmt.Sprintf("'%s'", v[0:len(v)-len(" +0000 UTC")])
|
return fmt.Sprintf("'%s'", v[0:len(v)-len(" +0000 UTC")])
|
||||||
|
|
Loading…
Reference in New Issue