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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get a User's Timezone
Power Apps
Unanswered

Get a User's Timezone

(0) ShareShare
ReportReport
Posted on by 17

I'm a new power automate user and I need some help finding a user's time zone.

I have a very simple flow that takes a newly posted SharePoint item and schedules a meeting on a shared calendar.

ericallenpaul_0-1613153590596.png

 

Right now users add a new item to SharePoint and then manually create an event on the shared calendar.

When done manually the event is always created in the user's local time zone. I'm in the eastern time zone so when I create an event for 10:15 AM to 12:15PM it shows up on the calendar in my time zone.
When created via the flow it starts with the time in the the pacific time zone, which I guess is the time zone for the SharePoint list. I know I can use the ConvertTime object to move it to another time zone but I want to be able to specify that time zone as the user's time zone. I am hoping to mimic the manual behavior exactly.

ericallenpaul_1-1613153804930.png

How can I get the user's time zone?

I've looked at other suggestions including:
https://powerusers.microsoft.com/t5/Building-Power-Apps/Get-current-user-s-timezone/m-p/280334#M81398
Which seems to be the closest answer I can find, but as far as I can tell there is no TimeZoneOffset() function.

Can anyone help me get the user's time zone?


Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @ericallenpaul 

    In general, your dates and times should be recorded and set as UTC.  If they are UTC, then the user's local time zone will come into play when they view the actual item and will format accordingly.

     

    I hope this is helpful for you.

  • ericallenpaul Profile Picture
    17 on at

    Thanks for your prompt reply.

    It seemed like I shouldn't need a conversion at all then right?

    Just take the date from the sharepoint form and use it in the outlook 'Create Event (V4)"--but that doesn't work.

    If I don't put a conversion in it just errors out because of the date.
    Am I missing something or should I be able to do this without any conversions?

  • ericallenpaul Profile Picture
    17 on at

    This seems way harder than it should be.

    First why should I have to even do any conversion on date and time? It's a date and time field from sharpoint being used in a date and time field in outlook. Why do I need to translate anything?
    I have no idea what time zone the sharepoint site is using. The times revealed in tests don't match anything that looks sane. All documentation I can find would lead me to believe that the time zone for the sharepoint list should be according to the region for the office 365 account.
    When I create an item on the sharepoint list it shows the created date as being +5 of my time. I am in the EST timezone so I would maybe expect to see -5 not +5. So the date being fed in from sharpoint itself starts out wrong.  I don't see a way to fix this when I'm lacking information as to why sharpoint shows the current date and time I set but sends some date and time that is +5 hours different.

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @ericallenpaul 

    Because timezone is based on the local settings of your device.  Interfaces in SharePoint and in your browsers will convert this to local time.  The date is however, stored in UTC (or actually based on the regional settings of your list).  Timezone offset is 0.  The TimeZoneOffset function will return the local timezone offset from UTC for the current device.

     

    So, while you might be seeing 2:50 PM ET in your sharepoint list, it is because your device is +5 time zone. And the date is converted for your viewing.

     

    So in order to get dates properly, you either need to make sure the regional settings of your list are accurate if you don't plan to use your app outside of the regional timezone, or you need to do the conversions.

     

    Since you don't know what the time settings on your site is...I would suggest looking at that first.

     

  • ericallenpaul Profile Picture
    17 on at

    Yeah I just tracked that down. In the Sharepoint "Regional" settings it says Pacific Time. That is expected since the parent company is in Oregon. But when I set it to pacific time in the conversion it's still doesn't seem right.
    So in sharepoint I add an item that starts today at 5PM and ends at 6PM.
     

    ericallenpaul_0-1614369962468.png

    I create this item at 3:04 PM EST. If this is in Pacific Time then I would expect the created date to be 12:04 PM.
    This is what Sharepoint sends:

    ericallenpaul_1-1614370159361.png

    A created date of 8:04 PM.
    Site Settings -> Site Administration - Regional Settings shows:

    ericallenpaul_2-1614370408975.png

    I'm missing something for sure but I can't make any sense out of the time being sent from Sharepoint into the flow

  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @ericallenpaul 

    Yes, what you are seeing is correct.  You created at 3:04 PM EST...that is 20:04 UTC

    Your data shows it is in UTC

    RandyHayes_0-1614370743898.png

    That Z at the end is your clue.

     

    When you view this in and interface (ie. your SharePoint view) in the EST region, it will show 3:04 PM EST

    When someone in your parent company looks at that same list in their browser, they will see 12:04 PM PST

    When you get that record from SharePoint in your PowerApp or PowerAutomate, it is 20:04 UTC

     

     

     

     

  • Verified answer
    ericallenpaul Profile Picture
    17 on at

    OK I understand it now.
    Thank you.

    -E

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @ericallenpaul 

    Clear as mud - right? 😂

     

    Glad it helped.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard