How to Convert Oracle Date to Unix Timestamp
(Doc ID 1377626.1)
Last updated on DECEMBER 25, 2019
Applies to:Oracle Database - Enterprise Edition - Version 10.2.0.1 to 220.127.116.11 [Release 10.2 to 11.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Information in this document applies to any platform.
This is sample code to show how to convert to and from Oracle date and timestamp to Unix timestamp. The code uses precision to 1000ths of a second. To get the old traditional Unix timestamp simply remove the multiplication or division by 1000 from the code.
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document
|--- Sample Code Output ---|