SQL> select sysdate, sysdate+numtodsinterval(1,'hour') from dual ;
SYSDATE SYSDATE+NUMTODSINTE
——————- ——————-
2010-10-14 21:38:19 2010-10-14 22:38:19
SQL> select sysdate, sysdate+numtodsinterval(50,'minute') from dual ;
SYSDATE SYSDATE+NUMTODSINTE
——————- ——————-
2010-10-14 21:39:12 2010-10-14 22:29:12
SQL> select sysdate, sysdate+numtodsinterval(45,'second') from dual ;
SYSDATE SYSDATE+NUMTODSINTE
——————- ——————-
2010-10-14 21:40:06 2010-10-14 21:40:51
SQL> select sysdate, sysdate+3 from dual ;
SYSDATE SYSDATE+3
——————- ——————-
2010-10-14 21:40:46 2010-10-17 21:40:46
SQL> select sysdate, add_months(sysdate,4) from dual ;
SYSDATE ADD_MONTHS(SYSDATE,
——————- ——————-
2010-10-14 21:41:43 2011-02-14 21:41:43
SQL> select sysdate, add_months(sysdate,12*2) from dual ;
SYSDATE ADD_MONTHS(SYSDATE,
——————- ——————-
2010-10-14 21:42:17 2012-10-14 21:42:17
SQL> select sysdate-to_date('20070523 21:23:34′,'yyyy-mm-dd hh24:mi:ss') dt from
dual ;
DT
———-
1240.01623
SQL> SELECT NUMTOYMINTERVAL(MONTHS_BETWEEN(DT1, DT2), ‘month') mon,
2 numtodsinterval(dt1-(add_months(dt2,trunc(MONTHS_BETWEEN(DT1, DT2)))
),'day') DAY
3 FROM (SELECT SYSDATE DT1,
4 TO_DATE('20070523 21:23:34′, ‘yyyy-mm-dd hh24:mi:ss') DT2
5 FROM DUAL)
6 ;
MON DAY
—————- ———————-
+000000003-04 +000000021 00:40:15.999999999