Time Difference Documentation
Version: 2.0.0
Retrieved:Â 2025-10-09 15:16:24
Time Difference
The module will calculate the difference between two datetimes.
Settings
| Name | Requirements | Purpose | Default |
|---|---|---|---|
| Source Property 1 | String with length 1-64 | The property that contains the first value to compare. | Â |
| Source Property 2 | String with length 1-64 | The property that contains the second value to compare. | Â |
| Target Property | String with length 1-64 | The name of the property that will contain the result (timestamp 1Â -Â timestamp 2). | Â |
| Time Unit | Milliseconds, Seconds, Minutes, Hours, Days, Months o Years | Time unit to use for the result. Note that a month is treated as 30 days and a year as 365 days. | Seconds |
Input
A message where the configured Source Property 1 and Source Property 2 properties contain valid DateTime values.
Output
The output will be the incoming message plus the calculated difference on the specified Target Property.
Example
# Settings:
Source Property 1 = 'date1'
Source Property 2 = 'date2'
Target Property = 'diff'
Time Unit = 'Days'
# IN:
{
"date1": "2009-06-15T13:45:30",
"date2": "2009-06-20T15:45:30"
}
# OUT:
{
"date1": "2009-06-15T13:45:30",
"date2": "2009-06-20T15:45:30",
"diff": -5.083333333333333
"crosser": {
"success": true
},
}
Search Documentation
Process & Analyze
Process & Analyze
Calculations & Statistics