Skip to main content

dateAdd

Adds the specified units of duration to the given date.

dateAdd(date, duration, unit)

Parameters#

  • date: A date in ISO-8601 format such as 2021-06-12T11:03:49.701Z provided as string
  • duration: A duration constant
  • unit: A number unit

Returns#

  • A new date with the specified duration units added

Duration#

ZWL provides values of duration as constants in form of a read-only map. When you type duration in editor, available constants are auto-completed.

Example#

dateAdd(timestamp(), duration.days, 7) # Adds 7 days to current date
dateAdd(timestamp(), duration.months, 1) # Adds 1 month to current date