cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JC75
Level: Powered On

UTC issues

I live in the UK - my windows 10 is set to UK locale settings. The UK is presently in BST settings, so the time is +1hr from UTC.

 

If I add a DatePicker to a PowerApp and set its defualt date to Today() and set the datetimezone to UTC its shows the date as yesterday! 

 

Testing this right now the time in the uk is 12:47pm, so 11:47am UTC - so why is it showing yesterday as the date?

 

Regards

2 REPLIES 2
Super User
Super User

Re: UTC issues

Hi @JC75

 

Just to give a bit of background for other readers, PowerApps generally attempts to convert datetime values to the local value. Taking the example of a system that stores UTC appointment times in a database, the controls in PowerApps will automatically convert the source data to the local time. Therefore, two concurrent users who are viewing a record in the UK and the US would see an appointment time that's relevant to their location.

When you set the DateTimeZone property of a datepicker control to UTC, the datepicker assumes that the input value is in UTC. The control will correct this input value and display the local value to the user.

Let's assume that I'm in the UK. If I run the Today() function at this moment, the function will return 16/08/2018. Note that the Today() function returns just the date component, whereas Now() returns both the date and time.

If I set the default property of a datepicker control to Today(), the control assumes an input value of '16/08/2018 00:00 UTC'. It recognises that my timezone is BST and subtracts 1 hour to show the input value in my local time. The resultant value is '15/08/2018 23:00', and that's the reason why you see yesterdays date in your control. Hope that clarifies things a little for you.

JC75
Level: Powered On

Re: UTC issues

Hi thanks for the explanantion and understand - and equally can see the value of when someone wants UTC times from a database to be shown in local times on a screen, dependent upon their location. But seems that the methodlogy and settings of powerapps could do with being made clearer - so that the user/developer can be more in control of if its all UTC or if it coverts (whether that be input or output) 

 

Someway of both globally and for individiual controls setting timezone method would make this all a lot simpler, as it equally becomes annoying when you are filtering lists/datasources, and having to consider x=today actually might not be the case!

 

For some apps we are developing it should always be UTC, both in what its displaying to user and outputting to any datasource, and i want it to never consider the location or if any form of daylight saving is taking place. An example is industries like aviation, it operates in UTC at all times, regardless of where in the world they are, so everything is displayed in UTC.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,563)