How to Combine a Date and a Time in Power Apps with DateTime
A date picker gives you a date, a time picker a time; many things need both, as one moment. DateTime builds it from the parts: DateTime(Year(d), Month(d), Day(d), Hour(t), Minute(t), 0) is time t on day d.
The example is the Overtime Timesheet app, which puts the start and finish times people choose onto the day the shift started.
Syntax
DateTime(Year, Month, Day, Hour, Minute, Second [, Milliseconds])
DateTime combines the Date and Time functions into a single function (Date, DateTime, and Time functions). The result is a date and time in the app user's time zone.
Step 1: Build a Date and Time
I put each formula into a text control's Text for a moment, so Studio's preview strip shows the result:
DateTime(2026, 10, 24, 22, 0, 0)
The strip shows 24/10/2026, 22:00:00, of type DateTime:

Step 2: Build It from a Date and a Time
With a date d and a time t, take the parts with Year, Month and Day and Hour and Minute. With names the two values so the formula reads clearly (How to Use the With Function in Power Apps):
With(
{d: Date(2026, 11, 6), t: Time(17, 30, 0)},
DateTime(Year(d), Month(d), Day(d), Hour(t), Minute(t), 0)
)
Half past five on 6 November:

Step 3: Use It with Real Controls
In the app, the date is a date picker's SelectedDate and the time is a combo box's chosen Time (How to Let Users Pick a Time in Power Apps). The app wraps the formula in a user-defined function, so every screen builds the start the same way (How to Create a User-Defined Function in Power Apps):
ShiftStart(ShiftDate: Date, StartAt: Time): DateTime =
DateTime(Year(ShiftDate), Month(ShiftDate), Day(ShiftDate), Hour(StartAt), Minute(StartAt), 0);
And calls it with the controls:
ShiftStart(dpWorkDateLO.SelectedDate, cmbStartLO.Selected.Value)
Why Not Add the Date and the Time?
Microsoft's data types page says adding and subtracting date and time values directly isn't recommended because time-zone and other conversions could cause confusing results. It recommends DateAdd and DateDiff for adding and subtracting.
DateTime sidesteps the question: it says which clock time on which day you mean. On the night the clocks went back in 2026, DateTime(2026, 10, 24, 22, 0, 0) and DateTime(2026, 10, 25, 6, 0, 0) were 540 minutes apart by DateDiff: nine real hours, although the clocks say eight. How to Calculate Hours Across a Daylight Saving Time Change in Power Apps shows it.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
Adding a time to a date with + | Microsoft warns of confusing results | Build it with DateTime |
| Passing a combo box record instead of its time | Hour(cmbStartLO.Selected) isn't a time | cmbStartLO.Selected.Value |
| Building a date and time from a blank date or time | A wrong moment, such as midnight | Check both with IsBlank first |
| Forgetting the seconds argument | DateTime needs it | Pass 0 |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| The time is midnight | The time was blank | Check that a time was chosen |
| The date is a day out in another time zone | Times are shown in each user's time zone | See Troubleshoot date and time issues |
FAQ
What time zone is the result in?
The app user's. Microsoft's data types page explains that canvas apps hold date and time values in UTC and show them in the user's time zone, which comes from the browser or device.
What about a finish time after midnight?
It belongs to the next day. Add a day to the date first when the finish is earlier than the start: How to Calculate Hours for an Overnight Shift in Power Apps.
Conclusion
DateTime(Year(d), Month(d), Day(d), Hour(t), Minute(t), 0) puts time t on day d. Wrap it in a function if several formulas need it, and let DateDiff measure between the results.
Additional Resources
- Date, DateTime, and Time functions: syntax and ranges.
- Data types: Date, Time, and DateTime: time zones and how values are held.
