Calculate the distance between dates
Calculate the distance between dates
Calculates the difference between two dates and returns the result in the desired time unit. Useful for checking deadlines, calculating ages, measuring time intervals or comparing dates in automation flows.
Options
Input Format
Defines the format of the dates given in the Start date and End date fields. Select the format matching the pattern of the dates in use, for example DD/MM/YYYY or YYYY-MM-DD.
Start date
Start date of the interval to calculate.
End date
End date of the interval to calculate.
Unit
Unit the difference will be returned in. The available options are: Years, Months, Days, Hours, Minutes and Seconds.
Returns
Javascript code
js
actions["action-id"].value // value of the distance between the dates in the selected unit (Number)
Field selection
- value — numeric value of the distance between the dates in the chosen unit (Number)
Rules and Conditions
- The Input Format, Start date, End date and Unit fields are required.
- The given dates must match the selected format exactly.
- The result is a whole number representing the difference in the chosen unit.