web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Calculating Past and F...
Power Automate
Suggested Answer

Calculating Past and Future Dates Based on the Current Date

(1) ShareShare
ReportReport
Posted on by
I have this automation flow where I need to calculate past and present days dates based on the current date. I might have been able to capture them but they are not based on my timezone. If I run it at 7 AM, Tuesday,  and try to get the current day
dayOfWeek(utcNow()), it returns a value of Monday. But when I run it again on 8 AM, it would return the correct day which is Tuesday.
 
 

I have these expressions to calculate next week's date:
Monday - addDays(utcNow(), sub(8, dayOfWeek(addHours(utcNow(), 8))), 'yyyy-MM-dd')
Tuesday - addDays(utcNow(), sub(9, dayOfWeek(addHours(utcNow(), 8))), 'yyyy-MM-dd')
Wednesday - addDays(utcNow(), sub(10, dayOfWeek(addHours(utcNow(), 8))), 'yyyy-MM-dd')
Thursday -  addDays(utcNow(), sub(11, dayOfWeek(addHours(utcNow(), 8))), 'yyyy-MM-dd')
Friday - addDays(utcNow(), sub(12, dayOfWeek(addHours(utcNow(), 8))), 'yyyy-MM-dd')
 
which when run on specific times of the day, also returns the previous day's date, like the behavior exhibited by my dayOfWeek(utcNow())
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,362 Super User 2025 Season 2 on at
     
    You need to use the Convert Time Zone Action to fix this.
     
     
    This way you can get the proper dates and times :-)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard