DAYS_ADD
Descriptionβ
Add a specified time interval to the date.
Aliasβ
- date_add
- days_add
- adddate
Syntaxβ
DATE_ADD(<date>, <expr> <time_unit>)
Parametersβ
Parameter | Description |
---|---|
<date> | A valid date value |
<expr> | The time interval you want to add |
<time_unit> | Enumerated values: YEAR, QUARTER, MONTH, DAY, HOUR, MINUTE, SECOND |
Return Valueβ
Returns the calculated date.
Examplesβ
select date_add('2010-11-30 23:59:59', INTERVAL 2 DAY);
+-------------------------------------------------+
| date_add('2010-11-30 23:59:59', INTERVAL 2 DAY) |
+-------------------------------------------------+
| 2010-12-02 23:59:59 |
+-------------------------------------------------+