Oracle Tutorial

  • Home
  • Start Here
  • Basics
  • Advanced
    • Oracle View
    • Oracle Index
    • Oracle Synonym
    • Oracle Sequence
    • Oracle Administration
  • PL/SQL
  • Functions
    • Aggregate Functions
    • Analytic Functions
    • Comparison Functions
    • Date Functions
    • String Functions
  • API
    • Python Oracle
Home / Oracle Date Functions / Oracle CURRENT_DATE

Oracle CURRENT_DATE

The Oracle CURRENT_DATE function returns the current date in the session time zone.

Syntax

The Oracle CURRENT_DATE function requires no argument and its syntax is as simple as follows:

CURRENT_DATE

Return value

The Oracle CURRENT_DATE function returns a DATE value in the Gregorian calendar.

Examples

The following statement changes the default date format to a new one that includes the time data:

ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';

To find out the session time zone, you use the SESSIONTIMEZONE function as follows:

SELECT SESSIONTIMEZONE FROM DUAL;

Currently, the session time zone is set to -07:00.

To get the current date in the session time zone, you use the following statement:

SELECT CURRENT_DATE FROM DUAL;

Here is the output:

06-AUG-2017 19:43:44

If you change the session time zone, the value of the current date is adjusted accordingly as shown in the following example:

First, set the session time zone to -09:00:

ALTER SESSION SET TIME_ZONE = '-09:00';

Second, get the current date of in the session time zone:

06-AUG-2017 17:45:33

The new current date was adjusted about -2 hours as expected.

In this tutorial, you have learned how to use the Oracle  CURRENT_DATE function to get the current date and time in the session time zone.

  • Was this tutorial helpful?
  • YesNo
Previous Oracle ADD_MONTHS
Next Oracle CURRENT_TIMESTAMP

Oracle Functions

  • Aggregate Functions
  • Analytic Functions
  • Comparison Functions
  • Date Functions
  • String Functions

Oracle Date Functions

  • ADD_MONTHS
  • CURRENT_DATE
  • CURRENT_TIMESTAMP
  • DBTIMEZONE
  • EXTRACT
  • FROM_TZ
  • LAST_DAY
  • LOCALTIMESTAMP
  • MONTHS_BETWEEN
  • NEXT_DAY
  • NEW_TIME
  • ROUND
  • SESSIONTIMEZONE
  • SYSDATE
  • SYSTIMESTAMP
  • TO_CHAR
  • TO_DATE
  • TRUNC
  • TZ_OFFSET

About Oracle Tutorial

OracleTututorial.com website provides Developers and Database Administrators with the updated Oracle tutorials, scripts, and tips.

Search

Recent Tutorials

  • Oracle Implicit Statement Results
  • Calling PL/SQL Stored Functions in Python
  • Calling PL/SQL Procedures in Python
  • Managing Transaction in Python
  • Deleting Data From Oracle Database in Python

Site Links

  • Oracle Books
  • About
  • Contact
  • Privacy Policy
  • Terms of Use

Copyright © 2021 Oracle Tutorial. All Rights Reserved.