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).

ParameterTypeDescription
dateString or ObjectRequired. The starting date.
numberInteger or StringRequired. 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.
intervalStringRequired. 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, or M/d/yyyy h:mm:ss a

  • ISO formats: yyyy-MM-dd, yyyy-MM-dd HH:mm:ss, yyyy-MM-dd'T'HH:mm:ss, or yyyy-MM-dd'T'HH:mm:ss.SSSZ

  • 12-hour time: M/d/yyyy h:mm a, yyyy-MM-dd h:mm a, or yyyy-MM-dd h:mm:ss a

  • Time-only: h:mm a or h:mm:ss a

    If you specify only a time, the helper function uses the current date.

  • Long-form English: d MMMM yyyy, MMMM d, yyyy, or EEEE, MMMM d, yyyy

  • Chinese and Japanese notation: yyyy年M月d日

  • Korean notation: yyyy년 M월 d일 or yyyy년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.