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 / How can I convert long...
Power Automate
Unanswered

How can I convert long-format datetime strings?

(0) ShareShare
ReportReport
Posted on by 2

I receive a string like this:

 

Saturday, July 31, 2021 1:35 AM | (UTC+01:00) Dublin, Edinburgh, Lisbon, London

 

I need to convert it to the format Sharepoint expects, i.e. a ISO 8601 for UTC:

 

YYYY-MM-DDTHH:MM:SS

 

I painfully built a flow that does most of the work, rearranging everything before the pipe to the expected format; however, at the thought of having to manually manage the timezone offset my heart finally gave out.

So my question is: what's the easiest way to parse this datetime correctly in PA/Flow...?

Categories:
  • Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at

    Hi @toyg_onestream,

     

    I gave this a shot with a couple of split functions. 

     

    Can you try this expression and test if it works properly?

     

    formatDateTime(formatDateTime(concat(split('Saturday, July 31, 2021 1:35 AM | (UTC+01:00) Dublin, Edinburgh, Lisbon, London', ' | ' )[0], split(split('Saturday, July 31, 2021 1:35 AM | (UTC+01:00) Dublin, Edinburgh, Lisbon, London', 'UTC' )[1], ')')[0]), 'dddd, dd MMMM yyyy HH:mm'), 's')

     

  • Powerplatform01 Profile Picture
    386 on at

    @toyg_onestream 

    You can take reference from this Video.Also request you to please subscribe this channel.

     

    https://youtu.be/NLEMPn-T3ns

    Let me know in case of further help

  • toyg_onestream Profile Picture
    2 on at

    So what you're saying it basically that the string

    Saturday, July 31, 2021 1:35 AM +01:00

    will be correctly interpreted as a UTC-based datetime by formatDateTime, which I can then reformat it as I see fit...?

  • Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at

    Hi @toyg_onestream,


    I haven't tested it with all the date time format patterns, but with the sortable format (s) it should work:

    https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings

     

    You can even test it with this expression:

    formatDateTime('Saturday, July 31, 2021 1:35 AM +01:00', 's')

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 211 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 190

Last 30 days Overall leaderboard