In a formula-type column, the DATEHOUR_ADD() function displays a date and time obtained by adding a number of hours to a date and time type column.
-
Function name:
DATEHOUR_ADD()
Syntax
DATEHOUR_ADD(date_column, number_of_hours)
Calling function parameters in TimeTonic:
- $field_name = field (link, linked table column, number, selection, formula, text...).
- "free text" = free text to add in quotes.
- do not use quotes for numbers.
Parameters
| Parameter | Description |
|---|---|
date_column |
The date and time type column to which hours will be added. |
number_of_hours |
The integer number of hours to add. Positive to move forward, negative to move backward. |
Example
DATEHOUR_ADD($Date, 5)
The column returns the date and time shifted by 5 hours.
Notes
- The source column must include the time.
- The number of hours can be negative.
Return type
The function returns a date and time.
The output format type 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
DATEHOUR_ADD() calculates an hourly deadline: end time of a slot, processing time to be met (for example within 4 hours).
Best practice
For minute-level shifts, use DATEMINUTE_ADD().