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

Powerapps changing my times for no reason

Hi All,

 

I just realised that when I am displaying a datetime or time, powerapps automatically add two hours.

As a reference, my timezone is GMT+1. 

 

I have tried timply "ThisItem.MyDateTime", I have tried Text (MyDateTime, "dd/mm/yyyy hh:mm") which gets automatically converted to "[$-en-US]dd/mm/yyyy hh:mm". I have tried using "[$-nl-NL]dd/mm/yyyy hh:mm" with NL beeing the same timezone.

 

In all cases, my hour ends up with 2 hours more. Please advice, it is driving me mad 😄

 

Cheers

1 ACCEPTED SOLUTION

Accepted Solutions
Regular Visitor

Re: Powerapps changing my times for no reason

I just found the fix here: 

 

https://powerusers.microsoft.com/t5/General-Discussion/PowerApps-time-zone-error/td-p/173976

 

It is pretty stupid that powerapps start handling and modifing dates without permission, but hey...

 

 

Using 

DateAdd( SomeDateValue , TimeZoneOffset(Now()), Minutes)

when displaying my time, fixes the issue... 

I also confirm this is linked to using the on premise gateway.

 

 

Cheers

View solution in original post

8 REPLIES 8
Highlighted
Advocate II
Advocate II

Re: Powerapps changing my times for no reason

So if you make a label with ThisItem.MyDateTime, you get 2 more hours than your actual time.

mmm

First of all, from this <<[$-en-US]dd/mm/yyyy hh:mm>> to this <<[$-nl-NL]dd/mm/yyyy hh:mm>> it only changes the standard text format, like commas or dots that are used in different countries.

 

Anyhow if you make a label and in the Text property you put this ?

 

Text(Now(); "[$-nl-NL]hh:mm:ss")

 

What is your result ?

Highlighted
Regular Visitor

Re: Powerapps changing my times for no reason

Hi ProNewbie

 

You understand correctly.

I just tried  Text(Now(), "[$-nl-NL]hh:mm:ss") and the date is right. So, it might be linked to the gateway i am using? It is a gateway that in one app connects to a MSSQL server and in another app to a MYSQL server. Connectors are different, gateway is the same.

 

Highlighted
Advocate II
Advocate II

Re: Powerapps changing my times for no reason

I think that the source is sending the wrong time to your PowerApp, but if you want you can "fix it" in this way :

Text(DateAdd(Now();
-2;
Hours);
"[$-nl-NL]dd-mm-yyyy hh:mm")

 

with this piece of code you are subtracting 2 hours from the current time,

replace <<Now()>> with <<ThisItem.MyDateTime>> and you should be good.

 

But I would recommend to check why your source is sending the wrong time haha

 

ProNewbie

Highlighted
Regular Visitor

Re: Powerapps changing my times for no reason

Thank you for the sugesstion, but that it way to dangerous on the long run.

I will investigate the connectors/gateway.

Highlighted
Advocate II
Advocate II

Re: Powerapps changing my times for no reason

yes of course it is, I was also thinking about checking if the source time hour is different from Now() and if it is it will fix itself by subtracting or adding hours to the source time, if it is not it will display the time and that's it.

It's a matter of using variables and a bit of time.

 

Any way good luck with checking your gateway/connectors :).

 

ProNewbie

Highlighted
Regular Visitor

Re: Powerapps changing my times for no reason

So, noone can help with this bug? 😞 

Highlighted
Advocate II
Advocate II

Re: Powerapps changing my times for no reason

If it's not a problem of PowerApps probably not, what is your datatime source ?

 

ProNewbie

Regular Visitor

Re: Powerapps changing my times for no reason

I just found the fix here: 

 

https://powerusers.microsoft.com/t5/General-Discussion/PowerApps-time-zone-error/td-p/173976

 

It is pretty stupid that powerapps start handling and modifing dates without permission, but hey...

 

 

Using 

DateAdd( SomeDateValue , TimeZoneOffset(Now()), Minutes)

when displaying my time, fixes the issue... 

I also confirm this is linked to using the on premise gateway.

 

 

Cheers

View solution in original post

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,804)