Search notes:

TIMESTAMP related Oracle SQL functions

FROM_TZ

select
           timestamp '2023-08-05 18:17:16'                    ts,
   from_tz(timestamp '2023-08-05 18:17:16', 'Europe/Zurich')  ts_zrh
from
   dual;
--
-- TS                            TS_ZRH                                     
-- ----------------------------- -------------------------------------------
-- 2023-08-05 18.17.16.000000000 2023-08-05 06.17.16.000000000 EUROPE/ZURICH

ADJ_DATE

The undocumented function adj_date round (truncates) a timestamp down to a non-fractional second.
create table tq84_t (
   ts  timestamp
);

insert into tq84_t values (systimestamp);

select
   ts,
   adj_date(ts)  ts_
from
   tq84_t;
--
-- TS                            TS_                          
-- ----------------------------- -----------------------------
-- 2022-02-23 18:46:58.658000000 2022-02-23 18:46:59.000000000

drop table tq84_t;
It seems that the function can only be used when applied on a column value. The following statement throws a ORA-00932: inconsistent datatypes: expected DATE got TIMESTAMP WITH TIME ZONE error.
select
   adj_date(systimestamp)
from
   dual;

TO_TIMESTAMP

select
   to_timestamp('2025-01-18 15:38:17.940294','yyyy-mm-dd hh24:mi:ss.ff')
from
   dual;

See also

Oracle SQL functions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1740477784, '18.119.125.91', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL/functions/timestamp/index(82): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78