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 / 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:
  • Verified answer
    v-yetonggu-msft Profile Picture
    Microsoft Employee 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,729 Super User 2026 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

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 377

#2
11manish Profile Picture

11manish 292 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 128

Last 30 days Overall leaderboard