cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
andiart
Helper I
Helper I

daylight savings, addDays and addToTime

Hello,

 

I have a power app, which creates events with the possibility to automatically create follow ups on a regular basis, like every 7 days, or every month and that x times in future. The recurring events I create with power automate. The events are saved into a sharepoint list.

 

When I create an event let's say on the 10.03. and chose 3 times follow ups every 14 days then the following dates are 24.03., 07.04. and 21.04.

My problem is, that because on the 27.03. the time in Berlin is being set forward one hour the dateAdd and addToTime calculate the time of the event one hour late. That is, when it was set on 8:00 it is for the 07.04. and 21.04. 9:00.

 

Everything else works correctly, when the events don't fall into the span of 27.03. the times are all correct. I set the sharepoint list on Berlin time UTC+1/2 and in the power app it's also my local time.

 

Any idea, why the commands react that way?

 

Andreas

5 REPLIES 5
fchopo
Super User
Super User

Hi @andiart 

You should always work with UTC, and then convert to desired time zone using "Convert time zone". Have a look at this thread: Support for daylight saving time - Power Platform Community (microsoft.com)

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hi @fchopo ,

 

unfortunately I can't change the timezon to utz on that particular sharepoint site, because a bunch of other stuff is there, which assumes it's set to Western Time.

fchopo
Super User
Super User

Hi,

I'm not saying you should change SharePoint site timezone. I mean that when working with times, always use UTC. So the steps would be:

1) Create the event in power apps

2) Convert date and times to UTC

3) Add days or whatever to converted time

4) Convert date and time to Western time zone.

Hope it helps!
Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hi @fchopo ,

thank you. It nearly works - in one case it does in the other not.

I have different repeat steps for the events. I first tested with my 14 days rhythm, that worked out fine. Then the respective formula on the 7 days steps doesn't. It shows an offset of two hours late when coming over the date of switching time.

 

the 14 days which works fine

convertFromUtc(addDays(convertToUtc(formatDateTime(triggerOutputs()?['body/Beginn'],'f'),'W. Europe Standard Time'), mul(variables('WDHCounter'), 14)), 'W. Europe Standard Time')

the 7 days which doesn't work right

convertFromUtc(addDays(convertToUtc(formatDateTime(triggerOutputs()?['body/Beginn'],'f'),'W. Europe Standard Time'), mul(variables('WDHCounter'), 7)), 'W. Europe Standard Time')

 

I only can assume, that with date conversion and daylight savings Power Automate is not that relyable, or do you see a clue?

 

Andreas

andiart
Helper I
Helper I

I changed it to overwrite the time portion from the original event on the time entry of the repating events. Even there it assumes it has to add 1 hours to the original event, because it used to be utc+1 and then utc+2.

 

Fortunately that it is not mission critical.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (2,366)