I am building a basic Power App the is using Excel Online as the data source. One of the Excel columns is Time - as in an appointment time. For the time to render in the Power App I am using the following: Property is set to Text - formula is Text(DateAdd(ThisItem.AppointmentTime, TimeZoneOffset(Now()), Minutes), "h:mm AM/PM"). This works great with the exception that is it off by one hour- example Excel cell is 9:30 AM; Power App renders this as 8:30 AM. It looks like this is due to a difference in UTC Time settings - SharePoint/OneDrive is UTC minus 8 (I am in the PDT timezone) where as the Power App function TimeZoneOffset is set to 420 minutes or UTC minus 7 hours. PowerApps is the correct time due to daylight savings time.
Any thoughts on how to hack this?
Solved! Go to Solution.
You need to supply the date of the appointment as a parameter inside the timezoneoffset() to get it to adjust correctly for daylight savings time. If the appointment date isn't the same as Now() you'll get the wrong offset.
Power apps has a TimezoneOffset() function that can be used to adjust for daylight savings time in a particular locale. DateAdd, DateDiff, and TimeZoneOffset functions in Power Apps - Power Apps | Microsoft Docs
Thanks @Pstork1 . I am using the TimezoneOffset() function to adjust for daylight savings time (UTC minus 7 for Pacific Daylight Time). When I look in the settings for SharePoint/OneDrive the time is set for UTC minus 8 - which I think this is the issue why the date in my Excel spreadsheet (hosted in OneDrive) is different by one hour than what is rendered in my Power App. Maybe this question needs to be asked in a different forum - SharePoint Online/OneDrive forum?
You need to supply the date of the appointment as a parameter inside the timezoneoffset() to get it to adjust correctly for daylight savings time. If the appointment date isn't the same as Now() you'll get the wrong offset.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
196 | |
69 | |
49 | |
46 | |
18 |
User | Count |
---|---|
249 | |
126 | |
84 | |
75 | |
74 |