I am trying to create a powerapp to display values from a SharePoint List. It auto-converts the datetime values to UTC and I couldn't get it to show them in the local time zone.
SharePoint List value | 7/14/2017 12:00 AM (Central Time) |
PowerApps display value | 7/13/2017 07:00 PM (UCT) |
I tried to manually add +5 hours to the time but there doesn't seem to be a TimeAdd function like DateAdd.
Do we have any workaround?
Thank you!
Shri
Solved! Go to Solution.
Hi @ShriAzure,
Check to see if the following article would be helpful:
DateAdd, DateDiff, and TimeZoneOffset functions in PowerApps
If you using PowerApps Studio, and the local time zone is the same as the time zone under the SharePoint site, then PowerApps should handle the Time correctly without any modification.
Further, if the time displays in the wrong timezone, please take use of the TimeZoneOffset function to convert from/To UTC:
To convert to UTC (Coordinated Universal Time), add the TimeZoneOffset for the given time.
DateAdd( TimeVariable, TimeZoneOffset(), Minutes )
To convert from UTC, subtract the TimeZoneOffset (by adding the negative) for the given time.
DateAdd( TimeVariable, -TimeZoneOffset( StartTime ), Minutes )
Regards,
Michael
Hi @ShriAzure,
Check to see if the following article would be helpful:
DateAdd, DateDiff, and TimeZoneOffset functions in PowerApps
If you using PowerApps Studio, and the local time zone is the same as the time zone under the SharePoint site, then PowerApps should handle the Time correctly without any modification.
Further, if the time displays in the wrong timezone, please take use of the TimeZoneOffset function to convert from/To UTC:
To convert to UTC (Coordinated Universal Time), add the TimeZoneOffset for the given time.
DateAdd( TimeVariable, TimeZoneOffset(), Minutes )
To convert from UTC, subtract the TimeZoneOffset (by adding the negative) for the given time.
DateAdd( TimeVariable, -TimeZoneOffset( StartTime ), Minutes )
Regards,
Michael
Thanks! This worked.. PowerApps Studio, SharePoint site are in the same local time zone. The SharePoint is hosted in the cloud (Office 365) if something that made PowerApps didn't auto-handle the time.
Thanks again! Your quick response is highly appreciated.
Shri
Can you please advise what is good practise for storing and displaying dates and times in this scenario. We are a global organisation, our Offfice 365 tenancy is in the USA and I am writing Powerapps for use in New Zealand. The Language() function returns "en-US" which is not correct for our users. There is no language tag for New Zealand. How is this best managed?
User | Count |
---|---|
135 | |
135 | |
78 | |
72 | |
69 |
User | Count |
---|---|
221 | |
137 | |
78 | |
60 | |
55 |