Skip to content

Timezone missing from TIMESTAMP WITH TIME ZONE #274

Open
@shatteringlass

Description

@shatteringlass
  1. What versions are you using?
platform.platform: Linux-5.3.18-24.64-default-x86_64-with-glibc2.3.4
sys.maxsize > 2**32: True
platform.python_version: 3.6.13
oracledb.__version__: 1.4.2
server: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
  1. Is it an error or a hang or a crash?
    Error: CURRENT_TIMESTAMP is returned as a timezone-unaware datetime

  2. What error(s) or behavior you are seeing?

When running SELECT CURRENT_TIMESTAMP FROM DUAL on DBeaver I get a TIMESTAMP WITH TIME ZONE
When running the script at the bottom of this report I get:

(datetime.datetime(2023, 12, 20, 18, 33, 28, 585660),)
Which is not timezone-aware

  1. Does your application call init_oracle_client()?

Yes it does

  1. Include a runnable Python script that shows the problem.
import oracledb

oracledb.init_oracle_client()

host = "hostname"
service_name = "servicename"
pw = "dbpass"
user = "username"

connection = oracledb.connect(
    user=user,
    sid=service_name,
    password=pw,
    host=host)

cursor = connection.cursor()
ts = cursor.execute("SELECT CURRENT_TIMESTAMP FROM DUAL").fetchall()
print("Current datetime: "+str(ts))

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions