In a formula-type column, the HOUR_DELTA() function calculates the difference, in hours, between two date and time type columns.
-
Function name:
HOUR_DELTA()
Syntax
HOUR_DELTA(moment_1, moment_2)
Calling function parameters in TimeTonic:
- $field_name = field (link, linked table column, number, selection, formula, text...).
- "free text" = free text to add inside quotation marks.
- do not use quotation marks for numbers.
Parameters
| Parameter | Description |
|---|---|
moment_1 |
The more recent moment (the result corresponds to moment_1 minus moment_2). |
moment_2 |
The reference moment to subtract. |
Example
HOUR_DELTA($End, $Start)
The column returns the number of hours difference between the two dates and times.
There is a 3 hour difference between the End column and the Start column.
Return type
The function returns a number (the difference expressed in hours).
The output type format of the result can be configured in the output field options of the formula editor. For more details, see Output format options in the Formula Column article.
Business use case
HOUR_DELTA() measures a duration in hours: time spent on a task, length of a time slot, response time.
Best practice
Both columns must include the time. For minute-level precision, use TIME_DELTA().