Category Archives: sql

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

Posted in sql | Leave a comment