Quick Search:
 
 The Oracle CURRENT_DATE Function      [Return To Index] Jump to:  

Term: CURRENT_DATE

Definition:
The Oracle CURRENT_DATE function returns the current date in the session time zone, in a value in the Gregorian calendar of datatype DATE. The format in which the date is displayed depends on NLS_DATE_FORMAT parameter. The default setting of NLS_DATE_FORMAT is DD-MON-YY. This returns a 2-digit day, a three-character month abbreviation, and a 2-digit year.

Example Usage:

CURRENT_DATE
SYSDATE
SELECT TO_CHAR(CURRENT_DATE, 'DD-MON-YYYY HH:MI:SS') FROM dual;


SELECT TO_CHAR(SYSDATE, 'DD-MON-YYYY HH:MI:SS') FROM dual;


To see the current system date and time with the time zone, use just the CURRENT_DATE function.
To see the current system date and time with fractional seconds and the time zone, use the following statement:

SELECT SYSTIMESTAMP FROM dual;


For example to see the current date in the format "Monday, 3rd May, 2010", use the following syntax:

SELECT TO_CHAR(sysdate,'Day, ddth Month, yyyy')"Today" FROM dual;


This will return the following (assuming today is 5/3/2010):

TODAY
------------------------
Monday, 3rd May, 2010


Related Links:

Related Code Snippets:
 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org