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 Automate
Answered

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:
  • RobElliott Profile Picture
    10,541 Super User 2026 Season 2 on at

    @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,331 Most Valuable Professional on at

    @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

    @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

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
Mohsin Ali Profile Picture

Mohsin Ali 424

#2
11manish Profile Picture

11manish 328 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard