Skip to main content

Notifications

Community site session details

Community site session details

Session Id : vhGJXSR4jWT0DbMWta/bty
Power Automate - General Discussion
Answered

Various ways to format date in long formats

Like (2) ShareShare
ReportReport
Posted on 27 Mar 2024 22:02:20 by 103

Dropping this here for someone starting out with Power Automate and having a hard time finding the right way to format dates.

* Get the year:

formatDateTime(triggerOutputs()?['body/start'],'yyyy')

Equals 2024

 

* Get the month:

formatDateTime(triggerOutputs()?['body/start'],'MM')

formatDateTime(utcNow(),'MMMM') which gives the result August.
so MM=08, MMM=Aug, MMMM=August

 

*Long format date

formatDateTime(triggerOutputs()?['body/start'],'MMMM dd, yyyy')

Equals March 27, 2024

 

*Get day of the week

formatDateTime(triggerOutputs()?['body/start'],'dddd MMMM dd, yyyy')

Equals Wednesday March 27, 2024

  • Verified answer
    CodeAvenue Profile Picture
    103 on 07 Aug 2024 at 19:07:10
    Various ways to format date in long formats
     

    Dropping this here for someone starting out with Power Automate and having a hard time finding the right way to format dates.
     

    * Get the year:

    formatDateTime(triggerOutputs()?['body/start'],'yyyy')

    Equals 2024

     

    * Get the month:

    formatDateTime(triggerOutputs()?['body/start'],'MM')

    formatDateTime(utcNow(),'MMMM') which gives the result August.
    so MM=08, MMM=Aug, MMMM=August

     

    *Long format date

    formatDateTime(triggerOutputs()?['body/start'],'MMMM dd, yyyy')

    Equals March 27, 2024

     

    *Get day of the week

    formatDateTime(triggerOutputs()?['body/start'],'dddd MMMM dd, yyyy')

    Equals Wednesday March 27, 2024

  • Chriddle Profile Picture
    7,680 Super User 2025 Season 1 on 28 Mar 2024 at 08:25:59
    Re: Various ways to format date in long formats

    There's a bit more to it (e.g. locale, single format specifier)

     

    To learn the basics I recommend to start here:

     

  • v-yueyun-msft Profile Picture
    on 28 Mar 2024 at 01:07:50
    Re: Various ways to format date in long formats

    Hi, @CodeAvenue 

    Thanks for sharing on the date format! You can use your own reply Mark as a solution, which can help more people!

     

    Best Regards,

    Yueyun Zhang

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,013 Most Valuable Professional

Leaderboard
Loading started