Search notes:

Exporting Oracle DATEs to Excel

Exporting date values from Oracle to Excel as string value is, IMHO, error prone because it must be relied on Excel interpreting the dates in the correct format.
It seems to be safer (albeit also a bit more tedious) to export Oracle date values in Excel's serial number format (i. e. the number of fractional days between the date and December 31st 1899.
Such a serial number value can be obtained by subtracting date 'date '1899-12-30' from the exported date:
select
   to_date('2024-02-16 12:34:56', 'yyyy-mm-dd hh24:mi:ss') - date '1899-12-30' serial_number
from
   dual;
The obtained value (in this example: 45338.5242592592592592592592592592592593) can then be copied into a cell in Excel and given the number format of a date. For example, in VBA with:
selection.value = 45338.5242592592592592592592592592592593
' selection.numberFormat = "dd/mm/yyyy hh:mm:ss"
selection.numberFormat = "yyyy-mm-dd hh:mm:ss"

Index