Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
3 views2 pages

Date Functions

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Date Functions

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

DATE FUNCTIONS

SQL> select sysdate from dual ;

SYSDATE
---------
24-JUN-24

SQL> select add_months('24-JUN-24',3) from dual;

ADD_MONTH
---------
24-SEP-24

SQL> select next_day('24-JUN-24','MONDAY') from dual;

NEXT_DAY(
---------
01-JUL-24

SQL> select next_day('21-JUN-24','MONDAY') from dual;

NEXT_DAY(
---------
24-JUN-24

SQL> select last_day('24-JUN-24') from dual;

LAST_DAY(
---------
30-JUN-24

SQL> select round(to_date('24-JUN-24'),'month') from dual;

ROUND(TO_
---------
01-JUL-24

SQL> select round(to_date('02-JUN-24'),'month') from dual;

ROUND(TO_
---------
01-JUN-24

SQL> select extract(month from sysdate) from dual;

EXTRACT(MONTHFROMSYSDATE)
-------------------------
6

SQL> select months_between('01-jan-25','12-dec-23') from dual;

MONTHS_BETWEEN('01-JAN-25','12-DEC-23')
---------------------------------------
12.6451613

SQL> select new_time('24-jun-24','CST','PST') from dual;

NEW_TIME(
---------
23-JUN-24

SQL> select new_time('25-jun-24','CST','PST') from dual;


NEW_TIME(
---------

24-JUN-24

SQL> select current_date from dual;

CURRENT_D
---------
24-JUN-24

You might also like