Skip to main content

How to Get the Year, Month and Day of a Date in Power Apps

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

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.

The example is the Log overtime screen of the Overtime Timesheet app, which takes the day a shift started apart to add the start and finish times to it.

Syntax​

Syntax
Year(DateTime)
Month(DateTime)
Day(DateTime)

Microsoft's Day, Month, Year, Hour, Minute, Second, and Weekday functions page describes the results:

FunctionReturns
YearThe year, starting with 1900
MonthThe month, 1 to 12
DayThe day of the month, 1 to 31

All three return a number.

Prerequisites​

Step 1: Get the Year​

I put each formula into a text control's Text for a moment, so the preview strip under the formula bar shows its result:

Any text control → Text
Year(dpWorkDateLO.SelectedDate)

The formula bar with Year(dpWorkDateLO.SelectedDate), the preview strip reading 2026 with Data type number, and the text control above the date picker 08/11/2026 showing 2026

Step 2: Get the Month​

Any text control → Text
Month(dpWorkDateLO.SelectedDate)

November is month 11:

The formula bar with Month(dpWorkDateLO.SelectedDate), the preview strip reading 11 with Data type number, and the text control showing 11

Step 3: Get the Day​

Any text control → Text
Day(dpWorkDateLO.SelectedDate)

The formula bar with Day(dpWorkDateLO.SelectedDate), the preview strip reading 8 with Data type number, and the text control showing 8

What They're For​

The example passes all three to DateTime, with an hour and minute, to build the moment a shift started on that day:

From the app's ShiftStart function
DateTime(Year(ShiftDate), Month(ShiftDate), Day(ShiftDate), Hour(StartAt), Minute(StartAt), 0)

How to Combine a Date and a Time in Power Apps with DateTime explains it.

For showing a date, or a month such as 2026-11, use Text instead: Text(dpWorkDateLO.SelectedDate, "yyyy-mm") gives the year and month with a leading zero (How to Format a Date in Power Apps with Text).

Common Mistakes​

MistakeWhat happensDo this instead
Joining the numbers to show a date, Day(d) & "/" & Month(d)No leading zeros, such as 8/11Text(d, "dd/mm")
Using Month for a month nameIt returns a numberText(d, "mmmm")
Taking the parts of a date that hasn't been chosen yetThe results don't describe the day you meantCheck IsBlank(dpWorkDateLO.SelectedDate) first

Troubleshooting​

SymptomLikely causeFix
The day is one offThe date was converted between time zones on the wayCheck the value with its time: Troubleshoot date and time issues
A text control shows 11 but you expected NovemberMonth returns a numberUse Text with "mmmm"

FAQ​

Is there a function for the day of the week?​

Yes, Weekday. Microsoft's page explains its numbering, which starts on Sunday unless you give it a different first day.

Do they work on a date and time too?​

Yes. They take any date/time value and ignore the parts they don't return.

Conclusion​

Year(d), Month(d) and Day(d) return a date's parts as numbers. Use them to build new dates and times; use Text to show a date.

Additional Resources​