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 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.
Screenshot 2025-01-02 112439.png
Categories:
  • David_MA Profile Picture
    15,607 Super User 2026 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 425

#2
11manish Profile Picture

11manish 323 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard