cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

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
Community Support

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,876)