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
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
There's a bit more to it (e.g. locale, single format specifier)
To learn the basics I recommend to start here:
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
Pstork1
20
Most Valuable Professional
Gprior
19
stampcoin
16