RPAUtils
Calculate distance between dates
Calculate 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 Initial date and Final date fields. Select the format matching the pattern of the dates in use, for example DD/MM/YYYY or YYYY-MM-DD.
Initial date
Start date of the interval to calculate.
Final 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 Initial date, Final date and Unit fields are required.
- The given dates must match the selected format exactly.
- The result is the difference in the chosen unit and may have decimal places (for example,
1.5days).