HOUR()

Count of hours from Duration

Returns the number of hours (Number value) represented by the given duration of time.

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(duration)

  • duration - 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?

Need more help?

Try these next steps:

true
Search
Clear search
Close search
Google apps
Main menu
8628353661627164554
true
Search Help Center
true
true
true
false
false