Handlebar Helper Function: DateAdd
Adds or subtracts a specific amount of time to a date. Use this helper to perform date arithmetic such as adding days to a date, subtracting months, or adjusting hours and minutes.
This helper is available in the Summer ’26 release of Marketing Cloud Next (API version 67.0).
| Parameter | Type | Description |
|---|---|---|
date | String or Object | Required. The starting date. |
number | Integer or String | Required. The amount of time to add. Use a negative value to subtract time from date. If you specify a string, the helper function tries to convert it to a number. |
interval | String | Required. The time unit to add or subtract. Possible values: "Y" (year), "M" (month), "D" (day), "H" (hour), "MI" (minute), "S" (second). |
You can specify date in these formats:
-
US formats:
MM/dd/yyyy,M/d/yyyy,MM/dd/yyyy HH:mm:ss,M/d/yyyy h:mm a, orM/d/yyyy h:mm:ss a -
ISO formats:
yyyy-MM-dd,yyyy-MM-dd HH:mm:ss,yyyy-MM-dd'T'HH:mm:ss, oryyyy-MM-dd'T'HH:mm:ss.SSSZ -
12-hour time:
M/d/yyyy h:mm a,yyyy-MM-dd h:mm a, oryyyy-MM-dd h:mm:ss a -
Time-only:
h:mm aorh:mm:ss aIf you specify only a time, the helper function uses the current date.
-
Long-form English:
d MMMM yyyy,MMMM d, yyyy, orEEEE, MMMM d, yyyy -
Chinese and Japanese notation:
yyyy年M月d日 -
Korean notation:
yyyy년 M월 d일oryyyy년M월d일
The function returns a date-time string in the format yyyy-MM-dd HH:mm:ss.
If the value of the date parameter is February 29th during a leap year, the helper uses February 28th to perform calculations. For example, {{dateadd "2024-02-29" 1 "Y"}} returns 2025-02-28 00:00:00.