fc339fc3 by slene

orm detect mysql timezone #403

1 parent 2c868a95
...@@ -126,7 +126,15 @@ func RegisterDataBase(aliasName, driverName, dataSource string, params ...int) { ...@@ -126,7 +126,15 @@ func RegisterDataBase(aliasName, driverName, dataSource string, params ...int) {
126 row := al.DB.QueryRow("SELECT @@session.time_zone") 126 row := al.DB.QueryRow("SELECT @@session.time_zone")
127 var tz string 127 var tz string
128 row.Scan(&tz) 128 row.Scan(&tz)
129 if tz != "SYSTEM" { 129 if tz == "SYSTEM" {
130 tz = ""
131 row = al.DB.QueryRow("SELECT @@system_time_zone")
132 row.Scan(&tz)
133 t, err := time.Parse("MST", tz)
134 if err == nil {
135 al.TZ = t.Location()
136 }
137 } else {
130 t, err := time.Parse("-07:00", tz) 138 t, err := time.Parse("-07:00", tz)
131 if err == nil { 139 if err == nil {
132 al.TZ = t.Location() 140 al.TZ = t.Location()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!