“I’ve got a date in the format MMddyyyy and I’d like to convert it into dd/MM/yyyy, how can I do that in Power Automate?”
The standard date format used in Power Automate is ISO 8601. You get dates in this format, use it as a basis when formatting the date, and often also to save them. But not all systems provide the date in the desired format. Since Power Automate can process inputs from various sources, the date format can vary a lot. You might receive attachments with timestamp as MMddyyyy, while the users expect that the date will be dd/MM/yyyy. How do you convert the date? Would you try to do some combination of many expressions to split the date and put it back together? Or do you prefer a simple solution with just 2 expressions?
Convert the date into ISO date
Conversion of a custom formatted date into another custom formatted date will take two steps. Firstly, convert the custom date into an ISO date. Secondly, take the ISO date and convert it into the desired format.
The easiest way to convert any date into an ISO date is to use the parseDateTime(…) expression. Let’s take the MMddyyyy date 05212022 as an example:
parseDateTime('05212022', 'en-US', 'MMddyyyy')
…and convert the date into an ISO formatted date.
2022-05-21T00:00:00.0000000
Convert the ISO date into different format
The ISO date itself is not pretty enough to show it to the users, but it’s the standard format for a flow. As such you can use the formatDateTime(…) expression to format it. The expression below:
formatDateTime('2022-05-21T00:00:00.0000000', 'dd/MM/yyyy')
…will format the date as:
21/05/2022
Combine the expressions
Now you can do it all in a single step by combining the two expressions.
formatDateTime(parseDateTime(<theDate>, <locale>, <sourceFormat>), <targetFormat>)
Note: <…> are placeholders, replace them including the < and >.
Following with the example from above:
formatDateTime(parseDateTime('05212022', 'en-US', 'MMddyyyy'), 'dd/MM/yyyy')

Summary
If you need to convert a date into another format in your Power Automate flow, you should consider using a middle step. Not trying to “brute force” the conversion, but converting it into another data format that’s easier to work with. In this case it was the conversion into ISO date that made the formatting much simpler, in other situations it can be splitting a string into an array to skip some parts of it.
Hi, Any way Formatting the day number in a date with st, nd, rd, th
For numbers that end in 1 – we add st (eg 1st, pronounced first)
For numbers that end in 2 – we add nd (eg 22nd, pronounced twenty-second)
For numbers that end in 3 – we add nd (eg 43rd, pronounced forty-third)
For all other numbers – we add th (eg 5th, pronounced fifth)
Hello Rakesh,
I never did that, but you could probably do it with multiple if(…) conditions, something like:
if(endsWith(‘date’,1), concat(‘date’,’st’), if(endsWith(‘date’,2), concat(‘date’, ‘nd’), if(endsWith(‘date’, 3), concat(‘date’, ‘rd’), concat(‘date’, ‘th’))))