15.3.2 numtodsinterval(value1, value2)

Function converts n to an INTERVAL DAY TO SECOND literal.The value for interval_unit specifies the unit of n and must resolve to one of the following string values:DAY,HOUR,MINUTE,SECOND.

Value 1 can be one of the following types: big integer, double, integer, float.

Value 2 can be one of the following types: text.

Returned value will be of type interval.

Function Result

numtodsinterval(34, "MONTH")

2 yy 10 mm

numtodsinterval(26.5, "HOUR")

1 dd 2 hr 30 mm 0 sec

numtodsinterval(1230, "MINUTE")

00 dd 20 hr 30 mm 0 sec

numtodsinterval(1, "DAY")

1 dd 0 hr 0 mm 0 sec