Time and TimeZone challenge. I know how to use the TimeZoneOffset, but am not sure if or how to use it to accomplish what I need to accomplish.
Here is the challenge.
Users - anywhere in the world
Challenge: Regardless of where the user of the app is located, I need to be able to determine if the time in CDT Timezone (UTC -06:00 or -05:00 during DST) is >= 11am and if so change the information that is being displayed.
I did come up with a possibility. In working with something totally unrelated to Power Apps, I discovered that our SharePoint online tenant time is Pacific Time. I could conceivably create an event calendar, and put a single repeating entry on it, (repeats every week at the time I want to switch), that I could use as the base for the time calculation.
I think I can figure something out using that. I just haven't had time to look at it yet.
Yes, wishful thinking!! 😉 I would settle with even some basics like getting back the current location and possibly even something that indicates if it is standard or daylight savings. Especially since you need this type of info for a lot of the calendaring actions on connectors.
Oh well...workarounds it is for now.
Too bad MS doesn't incorporate the TZ database so it can be used in these sorts of calculations.
You will need to determine the timezone for CT first. Your real challenge will be with the DST aspect. You will not be able to rely on that as it will give you different results based on different regions. Even parts of the US don't use DST, so those would always return a standard time.
Ideally you would want to convert all times CT and anywhere in the world, to standard time first. That will be the base line. To really put the logic in to do that, you need to put in the DST start and end dates. BUT, this still represents a problem with regions that don't use DST...as you'll not be able to get that region information.
SO, how to really combat this issue is going to be to think outside the box (or outside the app in this case). You can consider employing a web service that will return current time for a specified region. I can't name any off hand, but there are such services out there that can provide an API to do this.
The other option is to (since you want everything based off of the CT current hour), employ a flow that will run every hour and will update a list with the current CT hour. Then your app, anywhere in the world, can grab that from the list and use it in the comparison.
It's painful indeed as there is no real way to get specific region information in the app, so you kind of have to augment it. I know I've dealt with this with US-wide app (especially dealing with the regions that never observe DST) and the solution there was capturing the local date and time in the app and storing it as static text (not a date type column). Then, for comparison, the app grabs from the list that has the "central home" date and time.
Hopefully this gives you some ideas to consider.
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
mmbr1606
275
Super User 2025 Season 1