cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SamBa
Level: Power Up

Time zone from user profile not applicable

Hi Together,

 

I´m using an app in powerapps where I need to get start time from onclick event. Unfortunately the time is always wrong and not in the time zone from the user profile. I´m saving these data in CDS. What am I doing wrong? How can I convert the time in CET Time? This is the code Snippet(the Variable var_SchichtEndTime needs to be converted in CET or to use User Time Zone):

 

Reset(ti_ausschuss);; Reset(ti_gutstueck);; If(IsBlank(var_MachineState);Navigate(scr_Schicht;ScreenTransition.None);Set(var_showPopupSchicht;true);;Set(

    var_SchichtEndTime;

    Now()

))

 

Attached you can see that the Datatyp is correct and should use users time zone.

 

Thank´s for your help!

1 REPLY 1
Community Support Team
Community Support Team

Re: Time zone from user profile not applicable

Hi @SamBa ,

The Time Zone of your PowerApps is based on your local time zone in default.

It is concered by your current location, not the loaction that you set in user profile.

If you want to set the Time Zone for PowerApps dynamically, I afraid that there is no way to achieve your needs in PowerApps currently.

 

As an alternative way, I suggest you customize the time that returns.

But firstly you need to know the time zone that you want.

Then, convert current time to UTC:

Set(utctime,DateAdd( Now(), TimeZoneOffset(), Minutes ))

Convert UTC to the time zone that you want:

Set(var_SchichtEndTime,DateAdd( utctime, -timezone*60, Minutes ))

Please replace timezone with the one that you want.

Here'a doc about how to convert time to UTC for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-dateadd-datediff

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,801)