web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Users in Multiple Time...
Power Apps
Answered

Users in Multiple Timezones

(0) ShareShare
ReportReport
Posted on 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

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,386 Most Valuable Professional on at

    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.

  • EddieE Profile Picture
    4,650 Moderator on at

    @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?

  • BlessedCobba Profile Picture
    459 Super User 2024 Season 1 on at

    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

  • Verified answer
    EddieE Profile Picture
    4,650 Moderator on at

    @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 at

    @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)),

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard