Oracle / PLSQL: CURRENT_DATE function

This article is written about how to use the Oracle/PLSQL CURRENT_DATE function with syntax and examples.

Description

The Oracle/PLSQL CURRENT_DATE function returns the current date in the time zone of the current SQL session as set by the ALTER SESSION command.

Syntax

The syntax for the CURRENT_DATE function in Oracle/PLSQL is:

CURRENT_DATE

Parameters or Arguments

There are no parameters or arguments for the CURRENT_DATE function.

Returns

The CURRENT_DATE function returns a date value.

Applies To

The CURRENT_DATE function can be used in the following versions of Oracle/PLSQL:

Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i

Example

The CURRENT_DATE 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_DATE
from dual;

You might get the following result:

9/10/2005 10:58:24 PM

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_DATE
from dual;

You would now get the following result:

9/11/2005 3:58:24 AM

The session time zone value has changed from -7:0 to -2:0, causing the CURRENT_DATE function to return the current date as a value 5 hours ahead.