Blog
SharePoint - What to do when there's a mismatch between times in Power Apps and SharePoint
January 6. 2022
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
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.
- Categories:
- sharepoint
Related posts
- SharePoint - Deleting the last record from a SharePoint list - how NOT to do this!
- Walkthrough - An beginners guide to building an app that stores images in SharePoint
- SharePoint - Filtering lists by User() is now delegable
- SharePoint - How to fix the "skip to main content" error message on integrated forms, or to fix forms where records don't save
- SharePoint - Use this trick to perform a 'contains' type search in a more delegable way
- Sharepoint - Filtering records by yes/no columns bug - now fixed!
- Configuration - How to set the SharePoint address of a data source with a variable
- Data - How to make a copy of a record
- SharePoint - How to export and import lists and maintain lookup relationships
- SharePoint - how to fix list threshold errors when working with very large lists
- Data - How to move SharePoint sites, lists, and data
- Code - Can we hack SharePoint ID columns to be delegable using the greater than/less than operators?
- SharePoint - How to filter records by the current user
- SharePoint - Beware of numeric calculated columns!