Purpose
NUMTODSINTERVAL() converts n to a value of the INTERVAL DAY TO SECOND data type in the unit specified by interval_unit.
Syntax
NUMTODSINTERVAL (n,interval_unit)
Parameters
| Parameter | Description |
|---|---|
| n | An expression of the NUMBER data type or a data type that can be implicitly converted to the NUMBER data type. |
| interval_unit | The unit of the return value. Valid values: DAY, HOUR, MINUTE, and SECOND. These values are case-insensitive. |
Return type
The return type is INTERVAL DAY TO SECOND.
Examples
The following example returns a date 3 days after the current day.
obclient> SELECT SYSDATE,SYSDATE+NUMTODSINTERVAL(3,'DAY') AS "DAY" FROM DUAL;
+-----------+-----------+
| SYSDATE | DAY |
+-----------+-----------+
| 18-NOV-21 | 21-NOV-21 |
+-----------+-----------+
1 row in set