The Oracle SYSTIMESTAMP
function returns a TIMESTAMP WITH TIME ZONE
value that represents the system date and time including fractional seconds and time zone.
Syntax
The Oracle SYSTIMESTAMP
function accepts no argument:
SYSTIMESTAMP
Return Value
The Oracle SYSTIMESTAMP
function returns a TIMESTAMP WITH TIME ZONE
value that represents the system date.
Examples
The following statement shows the returned value of the SYSTIMESTAMP
function:
SELECT
SYSTIMESTAMP
FROM
dual;
Code language: SQL (Structured Query Language) (sql)
Here is the result:
07-AUG-17 01.08.16.408000000 PM -07:00
Code language: SQL (Structured Query Language) (sql)
To specify the value for fractional second argument e.g., 2-digit, you use the TO_CHAR()
function as follows:
SELECT
TO_CHAR(SYSTIMESTAMP,'DD-MON-YYYY HH24:MI:SS.FF2 TZH:TZM')
FROM
dual;
Code language: SQL (Structured Query Language) (sql)
The output is a character string with the following format:
07-AUG-2017 13:24:13.44 -07:00
Code language: SQL (Structured Query Language) (sql)
Noted that we used FF2
to format the timestamp with 2 digits for fractional second precision.
In this tutorial, you have learned how to use the Oracle SYSTIMESTAMP
function to get a TIMESTAMP WITH TIME ZONE
value that represents the system date and time including fractional seconds and time zone.