VeloDB Cloud
SQL Manual
Functions
date-time-functions
date_add

date_add

Description

Syntax:

INT DATE_ADD(DATETIME date,INTERVAL expr type)

This function adds a specified time interval to the date.

date is a valid date expression.

expr is the interval you want to add.

type can be any of the followings: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND

Example

mysql> 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                             |
+-------------------------------------------------+

Keywords

DATE_ADD,DATE,ADD