Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest Fabric, Power BI, and SQL learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
Calculated column
Calculated table
Measure
Visual calculation
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")
Date and time functions MINUTE function YEAR function SECOND function
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest Fabric, Power BI, and SQL learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today