Skip to main content

How to Calculate Hours Across a Daylight Saving Time Change in Power Apps

· 8 min read
Jagdish Kumawat
Founder @ Dewiride

Twice a year, a night shift is not the length its clock times suggest. When UK clocks go back in October, 22:00 to 06:00 is nine real hours; when they go forward in March, it's seven. Build the start and finish as real moments with DateTime and count minutes with DateDiff, and Power Apps counts the real time on both nights.

The example is the Overtime Timesheet app, built for a UK team. Its old Excel timesheet got this wrong: one night shift on the October clock change was recorded an hour short (How to Calculate Hours Worked Across a Daylight Saving Time Change in Excel).

The Two Nights in 2026​

From the UK government's When do the clocks change? page:

NightWhat happens22:00 to 06:00 is
28 to 29 MarchClocks go forward an hour7 real hours
24 to 25 OctoberClocks go back an hour9 real hours

How Power Apps Holds Times​

Microsoft's data types page says canvas apps hold and calculate all date/time values … in UTC, and show them in the user's time zone, taken from the browser or device. A date and time in a formula is a real moment, so the gap between two of them can include the extra or missing hour.

The app in this example ran in a browser set to London time.

Prerequisites​

Step 1: Count the October Night​

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

Any text control → Text
DateDiff(DateTime(2026, 10, 24, 22, 0, 0), DateTime(2026, 10, 25, 6, 0, 0), TimeUnit.Minutes)

540 minutes, nine hours:

The formula bar with DateDiff from DateTime(2026, 10, 24, 22, 0, 0) to DateTime(2026, 10, 25, 6, 0, 0) in TimeUnit.Minutes, the preview strip reading 540 with Data type number, and the text control showing 540

Step 2: Count the March Night​

Any text control → Text
DateDiff(DateTime(2026, 3, 28, 22, 0, 0), DateTime(2026, 3, 29, 6, 0, 0), TimeUnit.Minutes)

420 minutes, seven hours:

The formula bar with DateDiff from DateTime(2026, 3, 28, 22, 0, 0) to DateTime(2026, 3, 29, 6, 0, 0) in TimeUnit.Minutes, the preview strip reading 420 with Data type number, and the text control showing 420

On an ordinary night, such as 6 to 7 November, the same times are 480 minutes.

Step 3: See Why with TimeZoneOffset​

TimeZoneOffset returns the number of minutes between the user's local time and UTC for a given moment. Microsoft's date and time troubleshooting guide calls it the same offset that the Date Picker control and Power Fx use to adjust time zones and daylight savings.

At the start of the October shift, London was on summer time, an hour ahead of UTC:

Any text control → Text
TimeZoneOffset(DateTime(2026, 10, 24, 22, 0, 0))

The formula bar with TimeZoneOffset(DateTime(2026, 10, 24, 22, 0, 0)), the preview strip reading -60 with Data type number, and the text control showing -60

At the finish, it was back on UTC:

Any text control → Text
TimeZoneOffset(DateTime(2026, 10, 25, 6, 0, 0))

The formula bar with TimeZoneOffset(DateTime(2026, 10, 25, 6, 0, 0)), the preview strip reading 0 with Data type number, and the text control showing 0

The offset changed by 60 minutes during the shift: that's the extra hour DateDiff counted.

Step 4: The Hours in the App​

The app builds each shift's start and finish with DateTime, counts with DateDiff, and takes off the unpaid break. On the October night, with a 60-minute break, the screen shows 8.00 hours; Excel's clock arithmetic had recorded 7:

The Log overtime screen in Preview with the date 24/10/2026, Start 22:00, Finish 06:00, an unpaid break of 60 and Hours worked: 8.00 (8 h 0 min)

On the March night, the same times and break come to 6.00 hours:

The Log overtime screen in Preview with the date 28/03/2026, Start 22:00, Finish 06:00, an unpaid break of 60 and Hours worked: 6.00 (6 h 0 min)

No special case for the clock change is needed: the formula is the same every night.

Common Mistakes​

MistakeWhat happensDo this instead
Counting from the clock times aloneEvery night is 8 hours, including the two that aren'tCount between real moments with DateDiff
Counting in TimeUnit.HoursPart hours are droppedCount minutes, then divide by 60
Checking only an ordinary nightThe two clock-change nights go untestedTry 28 March and 24 October
Running the app in a different time zone from its usersThe clock change happens on other datesCheck in the time zone people work in

Troubleshooting​

SymptomLikely causeFix
The October night shows 8 hours before the breakThe times were counted without datesBuild both moments with DateTime
The clock-change night isn't differentThe device's time zone has no daylight savingCheck TimeZoneOffset() on that device
The hours look right in Studio but not for a userTheir device is set to another time zoneTimes follow each device's time zone

FAQ​

What about a shift that starts during the repeated hour?​

On 25 October, the hour from 01:00 to 02:00 happens twice, so a time in it names two different moments. The example didn't try a shift that starts or ends in that hour; check those by hand.

Do I need TimeZoneOffset in the calculation?​

Not here. DateDiff between two real moments already includes the change. TimeZoneOffset is for showing or converting to UTC: How to Convert Local Time to UTC in Power Apps with TimeZoneOffset.

Does SharePoint store the right times?​

The app saved this shift's start and finish to SharePoint, and the list showed 24/10/2026 22:00 and 25/10/2026 06:00 in the site's London time zone: How to Save a Date and Time to a SharePoint List with Patch in Power Apps.

Conclusion​

Build the start and finish as real moments with DateTime, count minutes with DateDiff, and the clock changes take care of themselves: 540 minutes on the October night and 420 in March, against 480 on any other.

Additional Resources​