PROCESIO
OverviewPlatform ActionsIntegrations & DemosMarketplaceCustom ActionsDeveloperโ€™s Guide

Time Difference

Counts the hours, minutes or seconds between two dates and times.

Time Difference tells you how far apart two moments are, in hours, minutes or seconds. Use it to measure how long a step took, to check a response time against an SLA, or to see whether a token has expired. For days and longer, use Date Difference.

Add the action

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

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

Inputs and outputs

FieldDirectionTypeRequiredWhat to put / what you get
Unit of TimeInputOption listYesSecond, Minute or Hour.
First DatetimeInputDate and timeYesThe start moment.
Second DatetimeInputDate and timeYesThe end moment.
DifferenceOutputIntegerYesSecond Datetime minus First Datetime, in whole units. Negative when the second moment is earlier.

Example

Unit of TimeFirst DatetimeSecond DatetimeDifference
Second2024-01-01T13:25:102024-01-01T13:26:0050
Minute2024-01-01T13:25:102024-01-01T14:25:0959 (one second short of an hour)
Hour2024-01-01T22:00:002024-01-03T01:30:0027
Hour2024-01-01T22:00:002024-01-01T19:30:00-2
Hour2024-01-01T12:00:00Z2024-01-01T12:00:00+02:00-2
Minute13:25:1014:00:0034

Good to know

  • The full date counts, not only the time: 22:00 on one day to 01:30 two days later is 27 hours.
  • Partial units are dropped, never rounded up: 59 minutes and 59 seconds is 59 minutes.
  • If you give only a time (13:25:10), both values are taken on the same day.
  • Offsets are respected: both values are converted to UTC before they are compared, so 12:00 UTC and 12:00 at +02:00 are 2 hours apart.

The result must fit in a whole number of about ยฑ2.1 billion. In Second, that is about 68 years. A longer span does not stop the step; it returns a wrong number (1950 to 2030 in seconds returned -1770359296). Use Minute or Hour, or Date Difference, for long periods.

On this page