feat: add ensureUTC function and apply it to datetime transformations in MSSQL processing
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"time"
|
||||
)
|
||||
|
||||
func mssqlUuidToBigEndian(mssqlUuid []byte) []byte {
|
||||
@@ -50,3 +51,11 @@ func wkbToEwkbWithSrid(geometry []byte, srid int) []byte {
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
func ensureUTC(t time.Time) time.Time {
|
||||
if t.Location() == time.UTC {
|
||||
return t
|
||||
}
|
||||
|
||||
return time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), time.UTC)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user