Use {{dateAdd}} to add or subtract a specific time offset (in milliseconds) from a given date, optionally applying a time zone for the resulting ISO 8601 timestamp. Typical uses include adjusting a date by days/hours or converting a timestamp to a particular time zone.
{{dateAdd dateField offsetField timeZoneField}}
-
dateField (required): The date to be adjusted (e.g., a string like
"2025-03-26T00:00:00Z", or a reference likerecord.orderDate). -
offsetField (optional): Time offset in milliseconds. Prepend a minus sign (
-) to subtract instead of add. For example,"86400000"= +1 day;"-86400000"= -1 day. -
timeZoneField (optional): A valid time zone identifier (e.g.,
"America/New_York","Asia/Hong_Kong"). If omitted, the output remains in UTC with no specific offset.
Note
-
For current UTC and world time zones, see Wikipedia's list of tz database time zones.
-
For a complete list of all available time and date format codes, see Time and date format codes.
-
For a complete list of all timezones supported by the Celigo platform, see integrator.io supported time zones.
-
No offset or time zone
{{dateAdd record.orderDate}}If
record.orderDateis"2025-03-26T12:34:56Z", the output is"2025-03-26T12:34:56.000Z"in ISO 8601 UTC format. -
Adding one day
{{dateAdd record.orderDate "86400000"}}If
record.orderDateis"2025-03-26T12:34:56Z", adds 24 hours and returns"2025-03-27T12:34:56.000Z". -
Subtracting twelve hours
{{dateAdd record.shipDate "-43200000"}}If
record.shipDateis"2025-05-10T00:00:00Z", subtracts half a day, yielding"2025-05-09T12:00:00.000Z". -
Applying a time zone
{{dateAdd record.orderDate "86400000" "Asia/Hong_Kong"}}If
record.orderDateis"2025-03-26T00:00:00Z", adds 24 hours and shifts to Hong Kong time, resulting in"2025-03-27T08:00:00.000+08:00". -
Hard-coded date string
{{dateAdd "Mon Nov 21 2019 20:00:00 GMT+0000"}}Outputs
"2019-11-21T20:00:00.000Z"in ISO format.
Tip
-
Offset values must be in milliseconds (e.g.,
86400000for one day). Scientific notation (e.g.,"1E6") is also supported. -
Negative offsets (e.g.,
"-86400000") subtract that time from the given date. -
Time zones use IANA identifiers (e.g.,
"America/Los_Angeles"). If you omit this parameter, the result is in UTC. -
The final output always conforms to an ISO 8601 date-time string, with or without the explicit offset depending on whether
timeZoneFieldis provided.