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

Community site session details

Session Id :
Power Automate
Unanswered

Format Date String

(0) ShareShare
ReportReport
Posted on by

Hello!

 

I seem to have some trouble trying to convert this string (12202019) into a correctly formatted date. We are receiving dates without any "/, -" just numbers.

 

I want to turn 12202019 --> 12/20/2019. I tried to use formatDateTime and couldn't figure out the correct way to do this.

Any suggestions?

 

Thanks.

Categories:
I have the same question (0)
  • RobElliott Profile Picture
    10,313 Super User 2025 Season 2 on at
    Re: Format Date String

    @apann have you tried using the Convert time zone control?

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

  • Verified answer
    ScottShearer Profile Picture
    25,268 Most Valuable Professional on at
    Re: Format Date String

    @apann 

    I don't believe that any of the date/time expressions or actions will work for you as they assume that you are starting with a valid date/time string.  I suspect that you'll need to use the substring() expression three times to break your string down into three parts.  Then use the concat() expression to put the parts back together with a "/" or "-" in between.  It's ugly but I don't see any other way.

     

     

  • Verified answer
    apann Profile Picture
    on at
    Re: Format Date String

    @RobElliott  Yes, I've tried that as well, but this only works if the date is already in a date-time format for ex: 11/22/3333.

    screenshot1.PNGscreenshot2.PNG

    But I found a workaround for this issue. I ended up breaking the string apart using the take() and skip() functions and concatenating the strings all together with a / in between. Which is somewhat close to @ScottShearer's idea.

    screenshot3.PNG

    So this works out, thanks guys.

     

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 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard