OpenBI Docs Buy

HOUR

The hour of a time, 0 to 23.

Group: Date and time. Compatible with DAX.

Syntax

HOUR ( <datetime> )
ParameterTypeDescription
datetimeDateA date with a time, a time, or text that reads as one.

Returns

Whole number. The hour, 0 to 23.

Remarks

  • A blank gives BLANK.
  • The hour is not rounded: 09:59:59 is hour 9.
  • A number's fraction is the time of day: HOUR ( 0.75 ) is 18.
  • Text such as "14:30" is read as a time.

Examples

The parts of a time

EVALUATE
VAR Moment = DATE ( 2024, 3, 15 ) + TIME ( 18, 5, 9 )
RETURN
    ROW ( "Hour", HOUR ( Moment ), "Minute", MINUTE ( Moment ), "Second", SECOND ( Moment ) )
HourMinuteSecond
1859

Not rounded, and from text

EVALUATE
ROW (
    "09:59:59", HOUR ( TIME ( 9, 59, 59 ) ),
    "Text", HOUR ( "14:30" ),
    "Three quarters of a day", HOUR ( 0.75 )
)
09:59:59TextThree quarters of a day
91418

MINUTE, SECOND, TIME, NOW.

Last updated · OpenBI Studio 0.3.74