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 / formatDatetime giving ...
Power Automate
Answered

formatDatetime giving wrong month

(0) ShareShare
ReportReport
Posted on by

I have a flow variable to find the first day of the previous month which gives me the correct date (but it adds a time)  I want to format the date to be mm-dd-yy

 

addtoTime(startOfMonth(addToTime(utcNow(),-1,'month')),0,'day')

value = 2020-01-01T00:00:00.0000000Z

 

When I add formatDateTime to the variable it gives me a wrong month

 

formatDateTime(addtoTime(startOfMonth(addToTime(utcNow(),-1,'month')),0,'day'),'mmmm-dd-yyyy')

Value = 00-01-2020

 

Any help would be appreciated

Categories:
I have the same question (0)
  • Verified answer
    RobElliott Profile Picture
    10,450 Super User 2026 Season 1 on at

    @trentskirush in Power Automate the month part of the expression must always be in upper case, i.e MMMM. Lower case is used for minutes.

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

  • TR-23071229-1 Profile Picture
    on at

    @RobElliott- thanks - I was thinking that might be it, but never got around to trying that.  thanks for the clarification.

     

     

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 573

#2
Valantis Profile Picture

Valantis 407

#3
11manish Profile Picture

11manish 387

Last 30 days Overall leaderboard