Description | The |
Syntax | DATE_ADD( |
Output | date |
Variables
date
: The initial date or datetime to which you want to add an offset.offset
: The numeric value representing the quantity of time you want to add."second/minute/hour/day/month/year": The unit of time (e.g., seconds, minutes, hours, days, months, years) you want to add to the initial date or datetime.
Example 1
DATE_ADD(`Start Date`, 2, 'hour')
Task | Start Date and Time | DATE_ADD(`Start Date`, 2, 'hour') |
Task A | 2023-09-10 10:30:00.000 | 2023-09-10 12:30:00.000 |
Task B | 2023-08-25 04:00:00.000 | 2023-08-25 06:00:00.000 |
Task C | 2023-09-01 17:15:00.000 | 2023-09-01 19:15:00.000 |
Example 2
DATE_ADD(`Start Date and Time`, -1, 'day')
Task | Start Date and Time | DATE_ADD(`Start Date and Time`, -1, 'day') |
Task A | 2023-09-10 10:30:00.000 | 2023-09-09 10:30:00.000 |
Task B | 2023-08-25 04:00:00.000 | 2023-08-24 04:00:00.000 |
Task C | 2023-09-01 17:15:00.000 | 2023-08-31 17:15:00.000 |