Skip to content
Home » Oracle » Derive Timestamp from SYSTIMESTAMP

Derive Timestamp from SYSTIMESTAMP


To have a timestamp as of now, we can use the function SYSTIMESTAMP.

SQL> select systimestamp from dual;

09-AUG-23 PM -04:00

As you can see, we have precise date, time and time zone in Oracle. This is a very typical presentation of a timestamp.

N Days Before

To get a timestamp which is some days before now, we can make some tests. In the following test, we try to use it just like we used to do to the function SYSDATE.

SQL> select systimestamp - 3 from dual;

2023-08-06 16:37:06

It seems that it casts to the type of datetime, then do the deduction. This is not a timestamp.


To get a timestamp from now, we should use INTERVAL clause to operate SYSTIMESTAMP.

SQL> select systimestamp - interval '3' day from dual;

06-AUG-23 PM -04:00

That's what we want precisely.

Leave a Reply

Your email address will not be published. Required fields are marked *