Skip to content

TO_DSINTERVAL

  • string: This parameter is a varchar2 datatype that represents the interval to be converted. The format for the string is ‘DY day HH
SELECT SYSTIMESTAMP + TO_DSINTERVAL('0 01:00:00.000') AS New_Timestamp
FROM dual;
NEW_TIMESTAMP
--------------------------------------------------------------------------------
08-MAR-22 03.50.45.123000 PM +00:00

The TO_DSINTERVAL function has been used to add 1 hour to the current system timestamp in this case. The string ‘0 01:00:00.000’ in the TO_DSINTERVAL function indicates ‘0 days, 1 hour, 0 minutes and 0 seconds’. The resultant timestamp is displayed under New_Timestamp.