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

Announcements

News and Announcements icon
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,963 Moderator 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 791

#2
Valantis Profile Picture

Valantis 582

#3
Haque Profile Picture

Haque 529

Last 30 days Overall leaderboard