Function · Date and time
Excel HOUR function
The Excel HOUR function returns the hour of a time, from 0 through 23. 9:30:45 AM returns 9. 9:30:45 PM returns 21.
Syntax =HOUR(serial_number)
=HOUR(TIME(9,30,45))Arguments
| Name | Required | What to pass |
|---|---|---|
| serial_number | Required | A time, or a date with a time. Only the time portion is used. 0 is midnight and 23 is 11 PM. |
Examples
The hour in 9:30:45 AM
=HOUR(TIME(9,30,45))Result 9
| A | B | |
|---|---|---|
| 1 | Time | 9:30:45 AM |
| 2 | Hour | 9 |
HOUR returns 0 through 23. The 9 in 9:30:45 AM is 9. The same clock time in the evening is 21. A date attached to the time does not change the hour. July 4, 2026 at 9:30:45 AM is still hour 9.
The cell should be a real time serial, from TIME or TIMEVALUE or a date-time. A text time often coerces in a US workbook and then fails when the locale changes. Midnight is 0, not 24. Noon is 12.