PROCESIO
OverviewPlatform ActionsIntegrations & DemosMarketplaceCustom ActionsDeveloperโ€™s Guide

Date Difference

Counts the days, weeks, months, quarters or years between two dates.

Date Difference tells you how far apart two dates are, in days, weeks, months, quarters or years. Use it to check how old an invoice is, how many months a contract has run, or whether a deadline has passed. For hours, minutes and seconds, use Time Difference.

Add the action

In the Process Designer toolbox, open DateTime and pick Date Difference (or type Date Difference in the search box).

The Date Difference action properties: Unit of Time, First Datetime, Second Datetime and Difference

Inputs and outputs

FieldDirectionTypeRequiredWhat to put / what you get
Unit of TimeInputOption listYesDay, Week, Month, Quarter or Year.
First DatetimeInputDate and timeYesThe start date.
Second DatetimeInputDate and timeYesThe end date.
DifferenceOutputIntegerYesSecond Datetime minus First Datetime, in the unit you chose. Negative when the second date is earlier.

How each unit is counted

  • Day: full 24-hour periods between the two moments. A remainder of less than a day is dropped, so the time of day matters.
  • Week: the number of week boundaries crossed, with weeks running Sunday to Saturday. Saturday to the next day, Sunday, already counts as 1.
  • Month, Quarter, Year: the number of calendar months, quarters or years crossed. The day of the month is ignored, so 31 January to 1 February is 1 month.

Example

Unit of TimeFirst DatetimeSecond DatetimeDifference
Day2024-01-01T00:00:002024-03-01T00:00:0060
Day2024-03-01T00:00:002024-01-01T00:00:00-60
Day2024-01-01T12:00:002024-01-02T11:00:000 (only 23 hours)
Week2026-11-07 (Saturday)2026-11-08 (Sunday)1
Week2026-11-02 (Monday)2026-11-15 (Sunday)2
Month2024-01-312024-02-011
Quarter2024-03-312024-04-011
Year2024-12-312025-01-011

Good to know

  • The order matters: put the earlier date in First Datetime to get a positive number.
  • For Day, the time of day counts. To count calendar days, give both dates the same time (for example 00:00:00).
  • A date with a UTC offset is first converted to UTC. An empty date stops the step with an error.

On this page