go-mssqldb
go-mssqldb copied to clipboard
The connection string support loc and parse time? About timezone problem
It's my connection string,
odbc:server=xxx;user id=xxx;password=xxx;port=1433;parseTime=true;loc=Asia/Shanghai;dial timeout=3;entrypt=false;TrustServerCertificate=true
and here is my code,
import (
_ "github.com/denisenkom/go-mssqldb"
)
func main() {
if MSSQLConn, err = sql.Open("mssql", connStr); err != nil {
return err
}
}
But all the time selected from db, the timezone is +0000 (Asia/Shanghai is +0800)? So it's supported parse time and loc parameters this driver?
Thanks.
I found the problem in type.go, any time parser is used time.UTC, I have forked the project and coding something to add the time local config features, could I submit this PR?
@lamjack 我遇到了同样的问题
@lamjack github.com/microsoft/go-mssqldb is accepting PRs!