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 / Converting a date stri...
Power Automate
Answered

Converting a date string (format ddmmyyyy) to datetime

(0) ShareShare
ReportReport
Posted on by 25

Hi there, I am trying to convert a string that has format ddmmyyyy to a standard DateTime format. I've tried using both formatDateTime and parseDateTime formulas in Power Automate but I keep getting this error: 

 

'In function 'parseDateTime', the value provided for date time string '23022024' was not valid. The datetime string must match ISO 8601 format.'.

 

Has anyone had a similar issue before?

Categories:
I have the same question (0)
  • Verified answer
    v-yetonggu-msft Profile Picture
    on at

    Hi @collinnunis ,

    I did a test for your reference.

    In my scenario:

    vyetonggumsft_0-1709611677755.png

    vyetonggumsft_1-1709611782953.png

    substring('23022024',0,2)
    substring('23022024',2,4)
    substring('23022024',4,4)
    parseDateTime(concat(outputs('Compose_Year'),'-',outputs('Compose_Month'),'-',outputs('Compose_Day')))

    Best Regards,

    Sunshine Gu

  • Verified answer
    collinnunis Profile Picture
    25 on at

    Hi @v-yetonggu-msft, thank you for your response. I thought about using substring or slice, but I was able to do it this way: 

     

    collinnunis_0-1709613802553.png

    The formulas I used:

     

    formatDateTime(concat(substring(item()?['End Date'], 4, 4), '-', substring(item()?['End Date'], 2, 2), '-', substring(item()?['End Date'], 0, 2), 'T00:00:00Z'), 'en-AU', 'dd/MM/yyyy')
    
    formatDateTime(concat(substring(item()?['Transaction Date'], 4, 4), '-', substring(item()?['Transaction Date'], 2, 2), '-', substring(item()?['Transaction Date'], 0, 2), 'T00:00:00Z'), 'en-AU', 'dd/MM/yyyy')
  • Verified answer
    Chriddle Profile Picture
    8,443 Super User 2025 Season 2 on at

    Why all these substrings?

    Use parseDateTime() with an appropriate format string:

     

    parseDateTime('23022024', 'es-es', 'ddMMyyyy')

     

     

    Chriddle_0-1709646289400.png

     

  • collinnunis Profile Picture
    25 on at

    Thank you so much @Chriddle !

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

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard