Purpose
The NUMTODSINTERVAL function converts the value of the n parameter to the INTERVAL DAY TO SECOND data type, based on the value of the interval_unit parameter.
Syntax
NUMTODSINTERVAL (n,interval_unit)
Parameters
Parameter |
Description |
|---|---|
| n | A NUMBER data type value or an expression that can be converted to the NUMBER data type. |
| interval_unit | The unit of the value. Valid values are DAY (day), HOUR (hour), MINUTE (minute), and SECOND (second). The value is not case-sensitive. |
Return type
INTERVAL DAY TO SECOND
Examples
Return the date three days after the current date.
obclient> SELECT SYSDATE,SYSDATE+NUMTODSINTERVAL(3,'DAY') AS "DAY" FROM DUAL;
+-----------+-----------+
| SYSDATE | DAY |
+-----------+-----------+
| 18-NOV-21 | 21-NOV-21 |
+-----------+-----------+
1 row in set
