Blog

SharePoint - What to do when there's a mismatch between times in Power Apps and SharePoint

If the daytime values from a SharePoint list don't correspond to the values that you see in Power Apps, this post describes the most likely cause.

Date time handling in Power Apps can be very complex, and it's easy for app builders to encounter situations where the time values in a data source don't correspond with the values that are shown in Power Apps. With SharePoint specifically, a typical cause is the SharePoint time zone setting.

Demonstration of issue

To demonstrate this issue, let's take the following list of records from a SharePoint list of meetings. Notice the start and end time values.



From a Power App, let's now display these records in a datatable control. Notice how the start and end times don't correspond with the values that appear directly in SharePoint.


Why is there a mismatch between SharePoint and Power App time values?

SharePoint stores UTC datetime values. Power Apps uses the region of the browser to determine the time zone of the user. It uses this to calculate the offset when saving and displaying time values.

SharePoint, however, uses the settings in SharePoint to determine the time zone. Where there is a mismatch in time zones, this can account for ambiguities in time values.

By default, SharePoint sites apply a United States time zone and locale. Therefore, this issue often affects users in other regions. In this example, my computer settings were set to the UK region, and the SharePoint site was set to the default US region. This accounts for behaviour that's demonstrated.

How to set the SharePoint time zone

To set the timezone in SharePoint, click the cog icon and click 'Site information'. From the 'Site information' panel, click the 'View all site settings' link.


From the 'Site Administration' group, click 'Regional settings'.


From the regional settings page, we can now modify the time zone setting.


Once we correct the timezone setting, datetime values will appear more consistently between SharePoint and Power Apps.

Conclusion

In situations where date time values in SharePoint don't correspond with the values that are shown in Power Apps, a likely cause is the time zone setting in SharePoint.