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

Add/subtract days to date and set format

(0) ShareShare
ReportReport
Posted on by

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,484 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
    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
    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

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard