How to Get the Year, Month and Day of a Date in Power Apps
Year, Month and Day take a date apart. For 8 November 2026 they return 2026, 11 and 8, as numbers, ready to build another date or time from the same day.
Year, Month and Day take a date apart. For 8 November 2026 they return 2026, 11 and 8, as numbers, ready to build another date or time from the same day.
For a number, such as a quantity or a break in minutes, use the modern Number input. It has up and down buttons, keeps the number between Min and Max, and moves by Step. Formulas read the number from Value, which changes when the person leaves the box.
The modern Power Apps controls include a Date picker but no time picker. A modern Combobox that lists every time of day does the job: people scroll to a time or type a few digits, such as 22, to narrow the list, and formulas read the chosen Time from Selected.
ForAll runs a formula once for every record of a table and returns a new table of the results, in the same order. Give it Sequence's numbers, and it can build a whole list in one formula: here, every time of day, five minutes apart, for a drop-down.
Sequence makes a table of numbers. Sequence(5) gives 1, 2, 3, 4 and 5; give it a start and a step, and Sequence(288, 0, 5) counts every five minutes of a day, from 0 to 1,435. Together with ForAll, it builds lists such as every time of day for a drop-down.
Some dates can't be in the future: the day a shift was worked, a delivery that has arrived, an accident that has happened. Set the modern date picker's EndDate to Today(), and its calendar greys out every day after today.
The modern Power Apps date picker's built-in formats follow the language the app runs in, so the same date can read differently from one person to the next. For an app used in the UK, set Format to the pattern "dd/mm/yyyy" so every date reads day first, and set StartOfWeek to Monday so the calendar matches a UK week.
When an app needs a date, give people a calendar instead of a text box. The modern Date picker control shows one: insert it, start it on today with DefaultDate, and read the date people choose from SelectedDate.
A formula checked IsEmpty(cmbEndLO.SelectedItems) to see whether a modern combo box had a choice yet. With nothing chosen, it still returned false, so the formula carried on with a blank value and showed 2 hours for a shift with no finish time. IsBlank(cmbEndLO.Selected) is the check Microsoft documents for "nothing selected", and it works.
The app gets its first real screen in this part. The Home screen greets the signed-in person, shows their department and, if they approve overtime, which departments they approve for. Its tiles depend on the person's role: everyone can log overtime, but only approvers, payroll staff and admins see the screens meant for them.