Duration (Time-based) to Number

Converts a time-based duration to a numeric value and appends it as a long or double column. You can select fields such as hours, minutes, seconds, milliseconds, microseconds, and nanoseconds. If the output is a long value, it truncates the result (e.g., 1 hour 30 minutes becomes 1 hour).
Often used to transform durations into numeric values for mathematical computations or aggregations.
Note: Only time-based durations can be converted to numbers. Date-based durations are not supported because their conversion is ambiguous (for example, the number of days in a month can vary).

Options

Duration columns
The columns to convert to a number.
Output mode
The behaviour for rounding the number.
  • Integer: Truncates the converted number, i.e. the duration 1 hour 30 minutes 30 seconds will be converted to 1 hour or 90 minutes or 5430 seconds etc., depending upon the value of the unit of the number.
  • Decimals: Outputs the exact converted number, i.e. the duration 1 hour 30 minutes 30 seconds will be converted to 1.508 hours or 90.5 minutes or 5430.0 seconds etc., depending upon the value of the unit of the number.
Granularity
The unit of the number to output.
Output columns
Depending on this setting, the output columns will either replace the modified columns, or be appended to the table with a suffix.
  • Replace: Replaces the selected columns by the new columns.
  • Append with suffix: Appends the selected columns to the input table with a new name that is the previous name plus the provided suffix.
Output column suffix
The suffix to append to the column names of the new columns.

Input Ports

Icon
Input table containing duration columns.

Output Ports

Icon
Output table with duration columns converted to numeric columns.

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.