cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Responsive Resident
Responsive Resident

Determine PST vs PDT

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

4 REPLIES 4
Resolver I
Resolver I

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.

Super User III
Super User III

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.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (9,864)