sijms / go-ora

Pure go oracle client
MIT License
786 stars 174 forks source link

get default time zone #440

Closed vivi-ui closed 1 year ago

vivi-ui commented 1 year ago

func (conn *Connection) getDBTimeZone() { var current time.Time err := conn.QueryRowContext(context.Background(), "SELECT SYSTIMESTAMP FROM DUAL", nil).Scan(&current) if err != nil { conn.dbTimeLoc = time.UTC

}
conn.dbTimeLoc = current.Location()

} it always current.Location(), but error is not null ,so current is alway a nil time
change: func (conn *Connection) getDBTimeZone() { var current time.Time err := conn.QueryRowContext(context.Background(), "SELECT SYSTIMESTAMP FROM DUAL").Scan(&current) if err != nil { conn.dbTimeLoc = time.UTC return } conn.dbTimeLoc = current.Location() }