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 / Add/subtract days to d...
Power Automate
Answered

Add/subtract days to date and set format

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I'm trying subtract one day from current time and call it sat with the format dd mmm yy, and add 5 days to current time and call it sun also with the format  dd mmm yy, I've tried using the add days action as well as the compose action but when I add the results to the email subject all I get is 

 

(Week of formatDateTime(triggerBody()?['2022-08-16T17:34:48.8377812Z'],'dd/MM/yyyy')+5 - 2022-08-16T17:34:48.8377812Z )

 

so the sunday is displayed 

 

2022-08-16T17:34:48.8377812Z'],'dd/MM/yyyy')+5.

 

is my syntax of, is there a better (proper) way to do this?

Any help would be greatly appreciated.


Derek

Categories:
I have the same question (0)
  • Sundeep_Malik Profile Picture
    6,499 on at

    Hey @Anonymous ,

    For these date type of problems in Power Automate, I use the tick method. Its pretty helpful.

    You can see how it works in the following post:

     

    How to find the number of days between two dates u... - Power Platform Community (microsoft.com)

     

    Fantastic solution for these date problems by @ScottShearer 

     

    I hope this reply will help you. If you have any doubts please reply. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @Sundeep_Malik 

     

    I looked at the link you provided, but I seem to have run into an issue. as per the images below, the flow does not seem to like Current time being converted into ticks;

    DWTKBrook_0-1660743625517.png

    I receive this error;

    DWTKBrook_1-1660743692152.png

    I don't want to find the difference between the two dates,

     

    I just want to subtract 1 day from current date to create a date that I will call Sunday and then

    Add 5 days to current date and call it Saturday and use both dates in a subject line of an email.

     

    Cheers!

     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello,

     

    I was able to resolve this allot easier that I allowed myself to realize . . . 

     

     

    I simple created 2 compose actions

     

    Saturday, expression set to formatDateTime(addDays(utcNow(), +5), 'MMM dd yyyy')

     

    and Sunday, set to formatDateTime(addDays(utcNow(), -1), 'MMM dd yyyy')

     

    done. 

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard