Hello,
I have an app that is used over sea's and in many time zones. I want certain features or behaviors altered depending on what time it is in the pacific time zone. How can I account for PDT vs PST? I see the function TimeZoneOffset() but the offset would vary from -7 to -8 depending on the time of the year.
In java I would use something like:
ZonedDateTime dateTime = ZonedDateTime.now(ZoneId.of("America/Los_Angeles"));
Which would account for this. How can I do this in PowerApps
Bad news is that PowerApps has no baked-in function for delivering you a user's Timezone, just the offset. The reasoning is probably that 99% of the time you only care about correcting for the conversion; not about the actual string representation of the timezone itself.
The Good news, however, is that this isn't impossible; just really, really annoying. Power Automate does let you pick specific time zone values and perform calculations on them, for example, getting the difference between Now() in Pacific time and Now() in UST. So, what you're going to need to do here is create a PowerAutomate Flow that gives you some useful data (i.e. the offset for Pacfic time right now) that you can compare to the user's timezoneoffset to decide where they are.
Hi @cchannon ,
You could get smart with Location.Longitude and have a table looking for values between to adjust the TimeZoneOffset by this amount.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Good point Warren, and if users are pretty well clustered in just a handful of urban centers that would probably be enough, but it would require requesting device location permissions which can be tricky to get users on board with.
@samuelJ As an alternative, you might consider looking up your user's record in whatever data source you are using. It might have the timezone there. Or, if you are feeling code-happy you could use a PCF to get it from AD.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
203 | |
182 | |
72 | |
44 | |
35 |
User | Count |
---|---|
331 | |
267 | |
116 | |
70 | |
65 |