Skip to main content
Community site session details

Community site session details

Session Id : ERew998zPDCFn5Wdr51Vyz
Power Apps - Building Power Apps
Answered

Users in Multiple Timezones

Like (0) ShareShare
ReportReport
Posted on 24 Aug 2022 00:36:15 by 459 Super User 2024 Season 1

Hi Community

 

I have a problem that i don't really know the best way to solve, done some searching and nothing gave me the kind of answer i wanted

 

I have a desk booking app that allows user to pick a date and time, using a SharePoint list as the Data Source and using outlook connector to create meeting invites. It all works great when the users are in a single timezone. but when users are in a different time zone things start to fall apart. 

 

The "Home" time zone is UTC +10 (During daylight savings UTC +11) then will have users from UTC +8 UTC +9:30. 

What i am looking for is regardless of where a user is, the data needs to be saved in the Home time zone. ie. if a user in UTC+8 and books a desk for 8AM it should save as 8AM in the Home time zone and not the users time zone

and be able to cater for the change in daylight savings

 

Cheers

  • BlessedCobba Profile Picture
    459 Super User 2024 Season 1 on 25 Aug 2022 at 04:11:13
    Re: Users in Multiple Timezones

    @EddieE 

    Ahhh the variable is the missing component to help with my set and forget 

    I used your variable and here is the patch button

     

    //See if the user is in the home timezone, if so just send the datetime, if they are not, do the math to convert to home time zone and then send
    
    CheckOutFrom: If(TimeZoneOffset(Now())/60 = vUTCHomeHrs, startTime, DateAdd(startTime,vUTCHomeHrs-TimeZoneOffset(Now())/60,Hours)),
     CheckOutTo: If(TimeZoneOffset(Now())/60 = vUTCHomeHrs, endTime, DateAdd(endTime,vUTCHomeHrs-TimeZoneOffset(Now())/60,Hours)),

     

     

  • Verified answer
    EddieE Profile Picture
    4,641 Moderator on 24 Aug 2022 at 22:10:40
    Re: Users in Multiple Timezones

    @BlessedCobba 

    I will need to see the code that sends the date to SharePoint to work out what's happening, I think? 

     

    I made a dummy setup like the below and using DateTimeValue() and TimeZoneOffset() you can get a UTC time that you can then just add +10/+11 depending on the time of year.

    EddieE_0-1661378885425.png

     

    With Daylight Saving months (I'm assuming with a name like BlessedCobba you are in Oz 🙂 ), hence the DLSMs are: Start = 4 (Apr) and End = 10 (Oct), which can be used in an If() condition to set a variable in the App OnStart, eg

     

     

    Set( vUTCHomeHrs,
     If(
     Month(Today()) in [4,5,6,7,8,9],
     10,
     11
     )
    )

     

     

  • BlessedCobba Profile Picture
    459 Super User 2024 Season 1 on 24 Aug 2022 at 06:03:42
    Re: Users in Multiple Timezones

    I was trying to get away with "hardcoding" it as we switch to daylight savings twice a year and that would require updating the code after the change to be UTC +11 instead of its current UTC 10 then back to UTC 10 after daylight savings ends

     

    The drop down is a simple pick an hour, no minutes 


    If the User selects 8AM in UTC 8 it saves and 10AM in the SharePoint as that is set to UTC 10,
    it also then creates the meeting invite at 8AM UTC 8, then when they travel to the other time zone it becomes 10AM UTC 10

  • EddieE Profile Picture
    4,641 Moderator on 24 Aug 2022 at 05:58:09
    Re: Users in Multiple Timezones

    @BlessedCobba 

    What have you tried so far? Have you tried incorporating TimeZoneOffset() into your app design? This function returns  ' ... the number of minutes between the user's local time and UTC (Coordinated Universal Time). ...' 

     

    For example

    TimeZoneOffset( Now() ) in +10 UTC returns -600 (mins) - this could be used as a conditional check in your code like

     

    If(
     TimeZoneOffset( Now() ) <> -600,
     // then
     ... then adjust for non-Home Zone times ...,
     // else
     ... use users time selected ... 
    )

     

    Also, how are you letting users pick dates/times? Is it with dropdowns for times eg

    1 x dropdown for hrs

    1 x dropdown for mins 

    ??

     

    And, what is happening now in the data ie

    User selects 8AM, in +8 UTC --> what gets added to SP as the time?

  • WarrenBelz Profile Picture
    148,864 Most Valuable Professional on 24 Aug 2022 at 05:52:00
    Re: Users in Multiple Timezones

    Hi @BlessedCobba ,

    The TimeZoneOffset Function returns the difference between the User's device and UTC. It is just a matter of adding/deducting the difference before writing the data taking into account the home time zone.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2