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).

Inputs and outputs
| Field | Direction | Type | Required | What to put / what you get |
|---|---|---|---|---|
| Unit of Time | Input | Option list | Yes | Second, Minute or Hour. |
| First Datetime | Input | Date and time | Yes | The start moment. |
| Second Datetime | Input | Date and time | Yes | The end moment. |
| Difference | Output | Integer | Yes | Second Datetime minus First Datetime, in whole units. Negative when the second moment is earlier. |
Example
| Unit of Time | First Datetime | Second Datetime | Difference |
|---|---|---|---|
| Second | 2024-01-01T13:25:10 | 2024-01-01T13:26:00 | 50 |
| Minute | 2024-01-01T13:25:10 | 2024-01-01T14:25:09 | 59 (one second short of an hour) |
| Hour | 2024-01-01T22:00:00 | 2024-01-03T01:30:00 | 27 |
| Hour | 2024-01-01T22:00:00 | 2024-01-01T19:30:00 | -2 |
| Hour | 2024-01-01T12:00:00Z | 2024-01-01T12:00:00+02:00 | -2 |
| Minute | 13:25:10 | 14:00:00 | 34 |
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
59minutes. - 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.

