Syntax
TIMESTAMPADD(unit, interval_expr, date)
Purpose
TIMESTAMPADD() adds a specified period to a date and return the result.
This function works in the same way as the DATE_ADD() function, but unit supports only the following units:
MICROSECONDSECONDMINUTEHOURDAYWEEKMONTHQUARTERYEAR
Examples
obclient> SELECT
TIMESTAMPADD(DAY, -5, '2010-01-01 00:00:00'),
DATE_ADD('2010-01-01 00:00:00', INTERVAL -5 DAY)
\G
*************************** 1. row ***************************
TIMESTAMPADD(DAY, -5, '2010-01-01 00:00:00'): 2009-12-27 00:00:00
DATE_ADD('2010-01-01 00:00:00', INTERVAL -5 DAY): 2009-12-27 00:00:00
1 row in set