Dates: Get Difference Between Two Dates

Use this action to calculate the difference between two dates and saves the result as an integer field.

Use case

  • Determine the amount of time taken for a task or instance to be completed.
  • Calculate the number of days until a task is due.

How to configure this action

To get the difference between two dates, the Start Date and End Dates need to be the right format. When using fixed values or referencing dates from a text type field, the acceptable date format is month-day-year (MM/DD/YYYY) or year-month-day (YYYY/MM/DD).

If incoming dates have an inconsistent format, you can use the Dates: Format a date time action beforehand to standardize dates. If incoming dates are in a Date type field, the dates will always work with this action.

Fields for this action

  • Start Date

    • A fixed date value, or a {{field-names}} reference for a date, text, or choice field type.
  • End Date

    • A fixed date value, or a {{field-names}} reference for a date, text, or choice field type.
  • Units

    • To return the difference in number of days, leave blank or enter DAY
    • To return the difference in number of business days (weekdays), enter BUSINESS. Business days are Monday to Friday.
  • Return field name

    • The name of the field in which the result should be saved. The step name is used by default.

What will this output?

The output is the integer difference between the Start Date and End Date, saved to the field defined in Return field name.

If the End Date occurs chronologically before Start Date, the difference will be returned as a negative integer.

Output fields for this action

  • Return field name

    • This field will store the integer difference between the Start Date and End Date. A negative result means the End Date was before the Start Date.

Tips

  • If this action is used after already formatting date/datetime values to a new format that is incompatible with this action, use the unformatted input of the Dates: Format a Date Time action as the Start Date or End Date in this action, rather than reformating the dates.

Sorry about that. What was the most unhelpful part?









Thanks for your feedback

We update the Help Center daily, so expect changes soon.

Link Copied

Paste this URL anywhere to link straight to the section.

Need more help?

If you're signed in to Catalytic Community, you can ask other users a question. You'll be redirected to Community where you can add more info.