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
Parameter | Type | Required | Description |
---|---|---|---|
timestamp | TIMESTAMP | Yes | The base timestamp |
unit | VARCHAR | Yes | The time unit to add (e.g., 'day', 'hour', 'month') |
value | BIGINT | Yes | The 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