cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
masonjrc
Frequent Visitor

Time inconsistent across devices

Hi all,

 

Ive been developing a powerapp which is connected to a list on sharepoint.

In my app theres a text label which contains the following expression:

Text(0,DateTimeFormat.ShortTime,"en")

If I open this on the powerapps development suite the label will display 11:00 AM, whereas when I open the app on my android smart phone it displays 10:00 AM.

I know 0 isn't a typical value for a date, but I came across this since I was trying to inclue a calculation based on time/date values from my list and found that the calculation was correct on my PC, but was an hour out on my phone.

I'm at a loss as to what's happening here.. Is my phone wrong or is there an error in my code?

1 ACCEPTED SOLUTION

Accepted Solutions
masonjrc
Frequent Visitor

Re: Time inconsistent across devices

Hi Andy thanks for your help but I did some futher digging around on these forums and realised that my problem is similar to the one mentioned in this post (and the post it links to): 

 

https://powerusers.microsoft.com/t5/PowerApps-Forum/Submit-form-issue/td-p/37267

 

As such I might try and implement the workaround suggested since I can't seem to find another way to get around the Time Zone problem.

View solution in original post

6 REPLIES 6
Power Apps
Power Apps

Re: Time inconsistent across devices

I would check the timezone/daylight savings settings on both devices. One of them appears to be wrong.

 

By using zero as a date, you are in effect displaying the timezone offset on the device. One device is UTC+11 and the other is UTC+10. Unless one is in a different timezone to the other, one is wrong.

masonjrc
Frequent Visitor

Re: Time inconsistent across devices

Hey Andy, thanks for your advice.

I had a play around and managed to figure out it was on my surface.

 

In settings>time & language, there is a slider that says "Adjust for daving saving time automatically" when I flick this to off it seems to fix the problem. 

I should also mention that if that slider is in the on position, it seems to still take affect even if you've turned "set time zone automatically" to on, which normally greys out the DST slider. 

So basically, whether the slider is greyed out or active, it will still cause this error unless it's in the off position.

 

 

masonjrc
Frequent Visitor

Re: Time inconsistent across devices

I just thought I'd add to this as although the problem of the 0 time being inconsistent has been fixed I'm still getting the wrong numbers in my calculation.

This expression: 

 

Text(Value(TimeValue(DataCardValue4.Text)))

 

yeilds the value of -3600000 on my PC and -7200000 on my phone. 

I have a label which is set to DataCardValue4.Text, and that reads: june 5, 2017 9:00 AM on both devices

This is confusing because now both devices are outputting 10:00 AM for the expression Text(0,DateTimeFormat.ShortTime,"en")

 

EDIT: I've found that this: Text(0,DateTimeFormat.ShortTime,"en") and this: Text(-3600000,DateTimeFormat.ShortTime,"en") both display 10:00AM on my phone... very confused....

 

Any ideas?

Power Apps
Power Apps

Re: Time inconsistent across devices

What does

TimeZoneOffset()

return on your two devices?

 

We do not recommend directly converting milliseconds into times.

masonjrc
Frequent Visitor

Re: Time inconsistent across devices

-600 on both

masonjrc
Frequent Visitor

Re: Time inconsistent across devices

Hi Andy thanks for your help but I did some futher digging around on these forums and realised that my problem is similar to the one mentioned in this post (and the post it links to): 

 

https://powerusers.microsoft.com/t5/PowerApps-Forum/Submit-form-issue/td-p/37267

 

As such I might try and implement the workaround suggested since I can't seem to find another way to get around the Time Zone problem.

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

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