There is a database (Oracle 19+) with columns that save the time a record is created (column created_on) and the time a record is modified (column modified_on).
At first, you may encounter the error ORA-01805: possible error in date/time operation error. The post on stack overflow (https://stackoverflow.com/a/72609092) contains the hint to check the timezone files on both side, the server side and the client side.
select * from v$timezone_file;On the client, change into the driver folder and call this command:
./genezi -vIf you need to use a diffrent version locally, set the environment variable export ORA_TZFILE=timezone_44.dat, without the path to the file.
ORA-01882
At a later point you may encounter the message OCI error ORA-01882: time zone region not found.
You can enable more verbose debugging output (source):
export DPI_DEBUG_LEVEL=12
The output will show that dpiStmt_fetchRows inside the C library throws the error:
ODPI [779371] 2026-07-28 11:48:20.461: fn start dpiStmt_fetchRows(0x72858c01c9c0)
ODPI [779371] 2026-07-28 11:48:20.462: OCI error ORA-01882: time zone region not found
Help: https://docs.oracle.com/error-help/db/ora-01882/ (dpiStmt_fetchRows / fetch)
ODPI [779371] 2026-07-28 11:48:20.462: fn end dpiStmt_fetchRows(0x72858c01c9c0) -> -1There are several things to look at:
- Is the column using
TIMESTAMPorTIMESTAMP WITH TIME ZONE? - If a trigger is setting the value for the column: is it using
LOCALTIMESTAMPorSYSTIMESTAMP? Which time zones are used?
SELECT DISTINCT TO_CHAR(created_on, 'TZR') AS region, TO_CHAR(created_on, 'TZD') AS d_id, TO_CHAR(created_on, 'TZH:TZM') AS timezone_offset FROM table ORDER BY timezone_offset;
The final solution is to cast the column in the query:
SELECT CAST(created_on AS TIMESTAMP) AS created_neutral
FROM my_table;