web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,195 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,195 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard