Export (0) Print
Expand All

HOUR Function

Returns the hour as a number from 0 (12:00 A.M.) to 23 (11:00 P.M.).

HOUR(<datetime>)

Term

Definition

datetime

A datetime value, such as 16:48:00 or 4:48 PM.

An integer number from 0 to 23.

The HOUR function takes as argument the time that contains the hour you want to find. You can supply the time by using a date/time function, an expression that returns a datetime, or by typing the value directly in one of the accepted time formats. Times can also be entered as any accepted text representation of a time.

When the datetime argument is a text representation of the date and time, the function uses the locale and date/time settings of the client computer to understand the text value in order to perform the conversion. Most locales use the colon (:) as the time separator and any input text using colons as time separators will parse correctly. Review your locale settings to understand your results.

The following example returns the hour from the TransactionTime column of a table named Orders.

=HOUR('Orders'[TransactionTime])

The following example returns 15, meaning the hour corresponding to 3 PM in a 24-hour clock. The text value is automatically parsed and converted to a date/time value.

=HOUR("March 3, 2008 3:00 PM")
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft