-
Notifications
You must be signed in to change notification settings - Fork 90
Closed
Labels
Description
The thin and the thick mode drivers behave differently with respect to timezones: thin uses UTC, whereas thick detects the local timezone. This is confusing for people migrating from cx_Oracle to the new thin driver, see e.g. #140.
It would be great if the thin mode driver would detect the local time zone, too, so that the following script always returns the same value, independent of the thick
flag.
import oracledb
user ="..."
password = "..."
dsn = "..."
thick = False
if thick:
oracledb.init_oracle_client()
with oracledb.connect(user=user, password=password, dsn=dsn) as connection:
with connection.cursor() as cursor:
tz = cursor.execute("SELECT SESSIONTIMEZONE FROM DUAL").fetchone()[0]
print(f"Timezone: {tz}")