Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle CURRENT_DATE Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

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      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 100 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?