Search notes:

Oracle SQL: TO_DATE

to_date() converts a string to a date.
to_date('...', 'fmt')
to_date('...', 'fmt', 'nlsparam')
to_date('...'  default '...' on conversion error, 'fmt')
to_date('...'  default '...' on conversion error, 'fmt', 'nlsparam')

Convert a Julian day to a date

A Julian Day can be converted to a date with the 'J' format specifier:
select
   to_date(2459496, 'J') -- October 8th, 2021
from
  dual;
Oracle counts the inexisting year 0. Thus, Julian days before the Year 1 are inconsistent with other Julian days:
select
   to_date(1721424, 'J'), --  0001-01-01
   to_date(1721057, 'J')  -- -0001-12-31
from
   dual;
The following select statement returns Oracle's earliest date it can process (-4712-01-01). (Note that due to Oracle's special Year-0 counting, the first Julian day is actually -4713-01-01).
select to_date(1, 'J') from dual;

See also

The default date format string for to_date is specified with the nls_date_format setting.
The error messages
Oracle format models for conversion 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...', 1756325905, '216.73.216.101', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL/functions/type-conversion/to_date/index(76): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78