Convertools Dev
All tools

Unix Timestamp in Oracle Database

Look up the current epoch time and convert between Unix seconds and UTC dates in Oracle Database.

Get the current timestamp

SELECT ROUND((CAST(SYS_EXTRACT_UTC(SYSTIMESTAMP) AS DATE)
              - DATE '1970-01-01') * 86400) FROM dual;

Timestamp to date

SELECT TIMESTAMP '1970-01-01 00:00:00'
       + NUMTODSINTERVAL(1700000000, 'SECOND') FROM dual;

Date to timestamp

SELECT ROUND((TO_DATE('2023-11-14 22:13:20', 'YYYY-MM-DD HH24:MI:SS')
              - DATE '1970-01-01') * 86400) FROM dual;

Open 1700000000 in the converter

Current Unix time

Seconds—
Milliseconds—
UTC
—
My time zone
—

Official reference ↗

Free to use. Your input stays in this browser.

How to use it

  1. Copy the current-time example into your Oracle Database environment to read Unix seconds.
  2. Run the second example to display 1700000000 as a UTC date.
  3. Run the last example to convert that date back into seconds.

Subtract two Oracle DATE values to get days, then multiply by 86,400 for seconds. Extract UTC from SYSTIMESTAMP before casting so the calculation uses the right time zone.