DateAdd is adding one hour more on 31.3.2024

Brass Contributor

Dear Ladies and Gentlemen,

 

in Power Apps I try to build a date with time.

 

From Date Picker I get the date.


From Dropdowns I add hours and minutes.

 

It is working well for all test dates I have chosen with exception of 31.3.2024.

 

For this date I get one hour more in the result.

 

I would say it is a bug.

 

Set(EventStartDay; dtpStartWeekly.SelectedDate);;
Set(EventStartDate; EventStartDay);;
Set(EventStartDate; DateAdd(EventStartDate;EventStartHours;TimeUnit.Hours));;
Set(EventStartDate; DateAdd(EventStartDate;EventStartMinutes;TimeUnit.Minutes));;

 

Thank you for your help.

Ladislav Stupak

7 Replies

HI @LadislavStupak,

 

Please change the Time zone adjustment of the date field if you can and set it to Time zone independent and try again.

Hi @sedattum,

thank you for your response.

How can I change the Time zone adjustment of the date picker object in Power App?

HI @LadislavStupak,

 

If it is a Canvas app, you can set the Date time zone to UTC.

Screen Shot 2024-03-19 at 08.14.05 AM.png

 

If it is a custom table, you can set it from the table in Columns by selecting the column and set the Time zone Adjustment to Time zone independent.

 Screen Shot 2024-03-19 at 08.16.55 AM.png

Hello @sedattum,

thank you for your response.

When I change this setting to UTC, then I receive bigger differences, but then also by any day and time selection. Even day before is displayed as the result.

HI @LadislavStupak,

 

Sorry for the late reply. In that case I would keep the date time control's time zone as local and check the your time zone settings in Power Apps. Please see the screenshots below.

  1.  Screen Shot 2024-03-27 at 21.27.32 PM.png
  2. Screen Shot 2024-03-27 at 21.28.13 PM.png
  3. Screen Shot 2024-03-27 at 21.28.33 PM.png

Hope this helps. 

Hello @sedattum,

thank you for your response.

In this setting I have also my own time zone selected.

On the 31.3.2024 will the time change from winter to summer time.

And therefore I think it happens that I get one hour more in the result.

But it does not happen on the 30.3.2024 and also not on the 1.4.2024.

Therefore I would say it is a bug.
Hi.

You are welcome. Winter and summer time should not affect the calculation. I would try to create a test app and test the same case on that app and see if you get the same results.