Skip to main content
Adds a specified time interval to a date.

Syntax

Parameters

  • date: It must be a valid date or datetime expression.
  • expr: the time interval you want to add. It must be of the INT type.
  • type: the unit of the time interval. It can only be set to any of the following values: YEAR, QUARTER, MONTH, DAY, HOUR, MINUTE, SECOND, MILLISECOND (since 3.1.7), and MICROSECOND (since 3.1.7).

Return value

Returns a DATETIME value. If the date does not exist, for example, 2020-02-30, NULL is returned. If the date is a DATE value, it will be converted into a DATETIME value.

Examples

Text