Oracle convert date to unix timestamp

convert oracle date to unix timestamp

SELECT ROUND((YOUR_COLUMN_DATE - TO_DATE('1970-01-01', 'YYYY-MM-DD')) * 86400) AS TIME,YOUR_COLUMN_DATE FROM YOUR_TABLE;

convert unix timestamp to oracle date

SELECT TO_DATE('1970-01-01', 'YYYY-MM-DD') + YOUR_COLUMN_TIME / 86400 FROM YOUR_TABLE
This entry was posted in sql. Bookmark the permalink.