Date&Time Difference

Calculates the difference between two date&time columns and appends the result in a new column. The difference can be output as either a duration or a number with a specified granularity (years, months, weeks, days, hours, minutes, seconds, milliseconds, nanoseconds). You can select the second date&time from another column, the execution date&time, a fixed date&time, or the previous row's date&time.
This node is commonly used to calculate time intervals between events for time series analysis or process monitoring.

Options

First date&time column
The first date&time column. The first and second column will be subtracted from each other, with the direction depending on the 'mode' option.
Second date&time value
The source of the second date&time value.
  • Column: Calculates the difference between the selected second column and the first column. Differences can only be calculated between columns of the same type. Using the Modify Time, Modify Date, and Modify Time Zone nodes you can adjust the date&time formats beforehand.
  • Fixed date&time: Calculates the difference between the selected fixed date&time and the first column.
  • Execution date&time: Calculates the difference between the execution date&time and the chosen first column.
  • Previous row: Calculates the difference between the date&time in row n and row n-1 in the chosen row. Note that the first row in the output will be MISSING as there is no previous row to calculate the difference with.
Second date&time column
The second date&time column to calculate the difference to.
Date
The fixed date to calculate the difference to.
Time
The fixed time to calculate the difference to.
Local date&time
The fixed local date&time to calculate the difference to.
Zoned date&time
The fixed zoned date&time to calculate the difference to.
Mode
The mode in which the date&time values are subtracted from each other: either subtract the second value from the first, or subtract the first from the second.
Output type
The type of the output column.
Granularity
The unit of the output column when converting to a number.
Output number type
The type of the numeric output column.
  • No decimals: The output column will be an integer. Applicable for all granularities.
  • Decimals: The output column will be a floating-point number. Not applicable for date-based granularities.
Output column name
The name of the output column.

Input Ports

Icon
Input table containing a date&time column.

Output Ports

Icon
Output table containing an appended column with the differences.

Popular Predecessors

  • No recommendations found

Popular Successors

  • No recommendations found

Views

This node has no views

Workflows

  • No workflows found

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.