Return Oracle Timestamp

1

I want to convert a date to a number, a timestamp. Within a select I need to return the timestamp beyond it.

Query example:

Select sysdate, TIMESTAMP_DE_SYSDATE from dual

Timestamp

is a time stamp (or time stamp) that is a string denoting the time or date that a certain event occurred. The chain is usually presented in a consistent format, allowing easy comparison between two distinct time stamps. In unix there is an important time stamp that defines the beginning of the Unix Era, "1970-01-01 00:00:00 UTC", used as a reference in the time calculation of this platform.

    
asked by anonymous 03.10.2017 / 14:47

1 answer

2

Unfortunately there is no native function in Oracle to get Unix datetime from a date.

The solution would be to do the calculation yourself, from the date of Unix epoch (01/01/1970). Here's an example:

SELECT sysdate, ((sysdate - TO_DATE('1970-01-01', 'YYYY-MM-DD')) * 60 * 60 * 24) FROM dual
    
03.10.2017 / 15:18