ADDHOURS
The ADDHOURS function returns a time value that is the result of adding a specified number of hours to a given time.
- Syntax:
- ADDHOURS (single-datetime-item-expression, hours-expressed-as-signed-integer-expression)
- Meaning:
- ADDHOURS (any_datetime, number_of_hours_to_add)
- Returns:
- A single datetime item
The ADDHOURS function returns a single datetime item that is advanced from the original value of the single-datetime-item-expression by the specified number of hours-expressed-as-signed-integer-expression.
Examples
ADDHOURS(TODATETIME("Dec 31, 1999 23:59:00"), 2)
Returns: Jan 1, 2000 01:59:00
ADDHOURS(TODATETIME("Dec 31, 1999 23:59:00"), -25)
Returns: Dec 30, 1999 22:59:00
ADDHOURS(TODATETIME("23:59:00"), 2)
Returns: 01:59:00
If either argument is invalid, the result is "none". If the second argument is "none", the result is the first argument. If the first argument contains only a time portion, date changes are ignored. If the first argument contains only a date portion, the time portion 00:00:00 will be used in the calculation. If both arguments are "none", the result is "none".
Related functions
- ADDDAYS
- DATETONUMBER
- NUMBERTODATE
- TEXTTODATE
- TODATETIME