DATE_ADD

All functions > DATE_AND_TIME > DATE_ADD

Returns the date after adding the given value to the given timestamp.

Syntax

DATE_ADD(timestamp, unit, value)
sql

Arguments

ParameterTypeRequiredDescription
timestampTIMESTAMPYesThe base timestamp
unitVARCHARYesThe time unit to add (e.g., 'day', 'hour', 'month')
valueBIGINTYesThe number of units to add

Returns

A new timestamp with the interval added

Notes

  • Adds a specified interval to a timestamp
  • Common units: 'second', 'minute', 'hour', 'day', 'week', 'month', 'year'
  • Value can be positive (future) or negative (past)
  • Useful for date arithmetic and scheduling
  • Handles month/year boundaries correctly

Examples

Last update at: 2025/10/13 10:23:46