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 Automate
Unanswered

How to AddMonths

(0) ShareShare
ReportReport
Posted on by 4
Hi, I am trying to add months let's say if the planned date is 13th January 2024 if add 1 month i want it to be 13th February 2024.
 
But using this code adding 1 month becomes 1st February 2024 instead. So how should I fix this issue?
 
This is the code that I used: formatDateTime(addToTime(coalesce(items('Apply_to_each_2')?['Planned Date'], utcNow()), 1, 'Month'), 'yyyy-MM-ddTHH:mm:ssZ')
 
note: the code I gave worked fine. the example I stated above is just an example, it is not in the format of the code I shared.
Categories:
I have the same question (2)
  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at
    I think you're saying your expression is returning MM/dd/yyyy instead of dd/MM/yyyy. If so, your expression needs to be formatted as formatDateTime(coalesce(addToTime(items('Apply_to_each_2')?['PlannedDate'],1, 'Month'), addToTime(utcNow(),1, 'Month')),'dd/MM/yyyy') instead.
     
    In your post, you mentioned the field name is “Planned Date” with a space. This could be causing your flow to fail since expressions use the internal name of the field, not the display name. Internal field names do not contain spaces and are often formatted differently, such as PlannedDate or Planned_Date.
     
    However, what you say your current expression is returning (1/2/2024) doesn't align with the format you use in your expression (yyyy-MM-ddTHH:mm:ssZ), so that doesn't make sense. Although it does align with what you have in the screen shot. So basically, you just need to change the date format at the end of your expression to what you want returned.
     
    If you have some other issue, I am not understanding what it is from what you posted.
  • CU02010321-0 Profile Picture
    4 on at
    Sorry for the confusion.
     
    The code that I gave worked fine but my issue is that it doesn't give me the day of the date exactly 1 month after like, for example, by adding 1 month to 13th January 2024 should give me 13th February 2024 but it instead gave me 1st February 2024.
     
    note: the example that I've given is just an example and not the exact format of the output.

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