HOUR()

Hour of day from Duration

Hour of day from the specified duration. Returns 0 if an hour is not found.

Sample usage

HOUR("007:14:21") : 7

HOUR(TIMENOW() - "00:00:00") returns hours since midnight; the current hour of the day. See also: TIMENOW()

HOUR((TODAY() + 1) - NOW()) returns hours until midnight. See also: NOW(), TODAY().

HOUR((DATETIME(TODAY() + 1) + "009:00:00") - NOW()) returns hours until 9:00 AM tomorrow. See also: DATETIME()

HOUR([Event Time] - NOW()) returns hours until the event time.

HOUR([Event Time] - [_THISROW].[Event Time]) returns hours between two event times.

Common problems

HOUR(NOW()) (or any DateTime or Time value in place of NOW()) causes Expression Assistant to complain, Parameter 1 of function HOUR is of the wrong type. The argument must be a Duration value, not a DateTime or Time value. To fix, convert a DateTime value to a Time value with TIME(), then subtract a zero time to convert a Time value to a Duration value: HOUR(TIME(NOW()) - "00:00:00"). See also: NOW(), TIME()

Syntax

HOUR(how-long)

  • how-long - A Duration value.

Notes

HOUR(...) is equivalent to (NUMBER(INDEX(SPLIT(TEXT(...), ":"), 1)) + 0) when ... is a Time value. See also: INDEX(), NUMBER(), SPLIT(), TEXT().

See also

Date and time expressions

MINUTE()

SECOND()

Was this helpful?
How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
false
false