This Oracle tutorial explains how to use the Oracle/PLSQL CURRENT_TIMESTAMP function with syntax and examples.
The Oracle/PLSQL CURRENT_TIMESTAMP function returns the current date and time in the time zone of the current SQL session as set by the ALTER SESSION command. It returns a TIMESTAMP WITH TIME ZONE value.
The syntax for the CURRENT_TIMESTAMP function in Oracle/PLSQL is:
CURRENT_TIMESTAMP
There are no parameters or arguments for the CURRENT_TIMESTAMP function.
The CURRENT_TIMESTAMP function returns a TIMESTAMP WITH TIME ZONE value.
The CURRENT_TIMESTAMP function can be used in the following versions of Oracle/PLSQL:
The CURRENT_TIMESTAMP function can be used in Oracle/PLSQL.
If the following ALTER SESSION command was issued:
ALTER SESSION SET TIME_ZONE = '-7:0';
And then the following SQL statement was executed:
select CURRENT_TIMESTAMP
from dual;
You might get the following result:
10-Sep-05 10.58.24.853421 PM -07:00
You then modified the session time zone with the following ALTER SESSION command:
ALTER SESSION SET TIME_ZONE = '-2:0';
And then the following SQL statement was executed:
select CURRENT_TIMESTAMP
from dual;
You would now get the following result:
10-Sep-05 03.58.24.853421 AM -02:00
The session time zone value has changed from -7:0 to -2:0, causing the CURRENT_TIMESTAMP function to return the current date and time as a value 5 hours ahead.