to_interval() function

Converts a string to a interval type. Can be used to take days, hours, month, etc off a date.

Syntax

to_interval('string')

Arguments

string - is string. Format {n} days {n} hours {n} months

Example

todatetime('2012-05-05 12:00:00') - to_interval('1 day 2 hours') → 2012-05-04T10:00:00