Date Formatting
The computeDate function can be used to calculate a date, or to change the displayed format of the date. The syntax of this function is:
While the computeDate function can alter how dates are displayed, the format in which dates are sent to CrossEngage must remain the same: ISO8601 format in UTC (Coordinated Universal Time). This can be written as YYYY-MM-DD.
Property | Type | Description |
| string | Optional. The user attribute that is used for date formatting and calculations. If omitted, the value 'now' is used, which takes the system time at the time of dispatch. e.g user.[traits.birthday] |
| string | Required. The operation that is executed on the |
outputFormat | string | Required. The format the function should output. All common date formats are supported e.g. |
Displaying the date 10 days from a user's birthday
For this example, we output the date 10 days from the User's birthday.
For example, if the User has his next birthday on 2022-01-01, it would compute the date 2022-01-11.
Last updated