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

Scheduled Flow using UTC and Daylight Savings Time EST

I have a flow that a user can choose what time to trigger the flow to grab tomorrow's calendar schedule. If I schedule the flow at 3pm EST, everything works fine. If I schedule the flow at 7pm EST, then I run into a problem with UTC. 

 

I set a variable called PullStartTime. PullStartTime should begin at midnight the upcoming day. IE: today is 3/15/21. I want PullStartTime to be 3/16/21

 

The expression used is: convertTimeZone(startOfDay(utcNow('dd MMM yyyy),1), 'hh:mm tt dd MMM yyyy'), variables('UserTimeZone'), 'UTC')

 

The problem is if the flow is triggered at 7pm EST, the UTC = midnight. Because of the the UTC, instead of PullStartTime equaling 3/16/21, it jumps forward to 3/17/21.

 

How do I eliminate this so no matter what timezone, the PullStartTime will be the next day of when the flow was triggered. 

 

Lastly, how do I solve for Daylight Savings Time. Is there a value I should use besides "Eastern Standard Time" to note that we have just moved from (UTC -5:00) to (UTC -4:00)?

 

Thanks. 

 

 

4 REPLIES 4
PrasadAthalye
Community Champion
Community Champion

Daylight savings should be an automatic switch as far as the trigger is concerned. I have a flow that runs every day at 7:15 PM. After daylight saving time changed, it still runs exactly at the same time. Refer below screen shot as its running at the moment.

PrasadAthalye_0-1615851926511.png

 

For the midnight next day, can you use the following logic? 

PrasadAthalye_2-1615852638758.png

formatDateTime(addDays(body('Convert_time_zone'), 1), 'yyyy-MM-ddTHH:mm:ss')

 

PrasadAthalye_1-1615852612365.png

 

 

 

 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

The issue isn't the time it triggers, it is what the PullStartTime expression thinks is the "next day". With my current expression for PullStartTime (which is not the same as the scheduled trigger), the capture of utcNow at 7pm EST is 12am UTC. That then sets my PullStartTime really 2 calendar days ahead than what I get when scheduling the trigger before 7pm which would be the next calendar day. 

 

Do you think the above would still work in my situation?

Maybe I'm looking at it wrong. Is there a way to capture the date based on my time zone vs UTC? Then maybe I create some expression that would add 1 day to the date for PullStartTime. ...Just thinking out loud. 

I understand the issue with UTC. That is the exact reason I am suggesting converting UTC back to Eastern time. That way It will be always today's date without the time factor. Then I am just adding 1 day so that it becomes tomorrow's date and time remains 00 which is midnight.

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,169)