How to Get the Hour and Minute of a Time in Power Apps
Hour and Minute take a time apart. For 22:30 they return 22 and 30, as numbers. Hour always counts on the 24-hour clock, from 0 to 23, whatever format the time is shown in.
The example is the Overtime Timesheet app, which reads the hour and minute of the times people choose and puts them onto the day the shift started.
Syntax
Hour(DateTime)
Minute(DateTime)
From Microsoft's Day, Month, Year, Hour, Minute, Second, and Weekday functions page:
| Function | Returns |
|---|---|
| Hour | 0 (12:00 AM) to 23 (11:00 PM) |
| Minute | 0 to 59 |
| Second | 0 to 59 |
They take any date/time value, including a Time on its own.
Step 1: Get the Hour
I put the formula into a text control's Text for a moment, so Studio's preview strip shows the result:
Hour(Time(22, 30, 0))

Step 2: Get the Minute
Minute(Time(22, 30, 0))

What They're For
In the example, people choose a time from a combo box (How to Let Users Pick a Time in Power Apps), and the app puts that time onto the date of the shift. Hour and Minute supply the time's parts to DateTime:
DateTime(Year(ShiftDate), Month(ShiftDate), Day(ShiftDate), Hour(StartAt), Minute(StartAt), 0)
StartAt is the chosen time, cmbStartLO.Selected.Value. How to Combine a Date and a Time in Power Apps with DateTime explains why this works on the nights the clocks change.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| Expecting Hour to return 10 for 10 PM | It returns 22 | Use it as a 24-hour number |
| Showing a time by joining Hour and Minute | 9:5 instead of 09:05 | Text(t, "hh:mm") |
| Reading the combo box's record instead of its time | Hour(cmbStartLO.Selected) isn't a time | Hour(cmbStartLO.Selected.Value) |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| The hour is 0 for a time no one chose | The time is blank | Check IsBlank before using it |
| Minutes look rounded | The time list only has whole minutes, such as every five | That's the list, not Minute |
FAQ
How do I get the minutes since midnight?
Multiply the hours by 60 and add the minutes: Hour(t) * 60 + Minute(t).
Is there a function for seconds?
Yes, Second, from 0 to 59.
Conclusion
Hour(t) and Minute(t) return a time's parts as numbers, the hour on the 24-hour clock. Use them to place a time on a date or to count minutes; use Text to show a time.
Additional Resources
- Day, Month, Year, Hour, Minute, Second, and Weekday functions: ranges and examples.
- Date, DateTime, and Time functions: making times and dates from parts.
