Member-only story

Converting Date Strings in Any Language to ISO Format in Power Automate

Venkadesh Sundaramurthy
1 min readSep 6, 2024

--

Consider a scenario where you receive date strings in different languages and formats, and you need to standardize them into ISO format (YYYY-MM-DD)

For instance, suppose you’re presented with date strings in French format, such as “mercredi 14 février 2024” (Wednesday, 14 February 2024), and you need to convert them into a different date format for further processing.

Step-by-Step Guide:

  1. Parse Date String: We begin by using the ‘parseDateTime’ function to convert the date string into a recognizable date-time format. For example:

formatDateTime(parseDateTime(‘mercredi 14 février 2024’, ‘fr-FR’, ‘dddd d MMMM yyyy’), ‘yyyy-MM-dd’)

2. Format Date Time: Once we have parsed the date string into a date-time value, we format it into the desired ISO format using the ‘formatDateTime’ function. For example:

formatDateTime(parsedDate, ‘yyyy-MM-dd’)

Practical Example: Let’s convert the French date string “mercredi 14 février 2024” into the ISO 8601 date format “2024–02–14”. We would use the following expression:

formatDateTime(parseDateTime(‘mercredi 14 février 2024’, ‘fr-FR’, ‘dddd d MMMM yyyy’), ‘yyyy-MM-dd’)

Conclusion: In this blog post, we’ve demonstrated how to convert date strings from any language to ISO format using Power Automate. By leveraging the ‘parseDateTime’ and ‘formatDateTime’ functions, we can seamlessly handle date strings in multiple languages, enhancing the flexibility and efficiency of our automation workflows.

--

--

Venkadesh Sundaramurthy
Venkadesh Sundaramurthy

Written by Venkadesh Sundaramurthy

Solution Architect | Microsoft 365 | SharePoint | Power Platform | Azure | Integration | Automation | Super User in Power Automate community

No responses yet