Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Lj9j/Exioej7RFJuxkH4lf
Power Automate - General Discussion
Answered

How to convert string dd/mm/yyyy hh:mm to datetime with format dd/mm/yyyy hh:mm

Like (0) ShareShare
ReportReport
Posted on 14 Feb 2021 13:03:27 by

Dear Experts

 

I have been practising with datetime conversion from string to datetime format and I am really struggling

 

Below the flow 

 

AlessandroP_0-1613307556161.png

Formatdatetime(variables('DateTime'),'dd/mm/yyyy HH:MM')

 

but when I run it , I get the following error

 
 

Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2437': 'In function 'formatdatetime', the value provided for date time string '14/02/2021 15:32' was not valid. The datetime string must match ISO 8601 format.'.

 

Any help please?

 

 

 

  • diegocruzb96 Profile Picture
    22 on 21 Jul 2023 at 22:10:54
    Re: How to convert string dd/mm/yyyy hh:mm to datetime with format dd/mm/yyyy hh:mm

    Thanks man !!

  • Community Power Platform Member Profile Picture
    on 14 Feb 2021 at 19:12:15
    Re: How to convert string dd/mm/yyyy hh:mm to datetime with format dd/mm/yyyy hh:mm

    Thank you Sir, you are a star

  • Verified answer
    jinivthakkar Profile Picture
    4,179 on 14 Feb 2021 at 17:14:59
    Re: How to convert string dd/mm/yyyy hh:mm to datetime with format dd/mm/yyyy hh:mm

    @Anonymous 

     

    jinivthakkar_0-1613322723151.png

    jinivthakkar_1-1613322777691.png

    jinivthakkar_2-1613322814878.png

     

    Expressions used 

    split(variables('Datetime'),' ')
    
    split(outputs('Compose_2')[0],'/')
    
    formatDateTime(concat(outputs('Compose_4')[2],'-',outputs('Compose_4')[1],'-',outputs('Compose_4')[0],' ',outputs('Compose_2')[1],':00'),'yyyy-MM-dd HH:mm')

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

     

     

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on 14 Feb 2021 at 17:08:55
    Re: How to convert string dd/mm/yyyy hh:mm to datetime with format dd/mm/yyyy hh:mm

    @Anonymous You need to use split expression here.

    Hardesh15_0-1613322473623.png

    Hardesh15_1-1613322504693.png

    Please 'Thumbs Up' the posts that helped you and 'Mark as Solution' if my post answered your question.

    @Hardesh

     

     

  • Community Power Platform Member Profile Picture
    on 14 Feb 2021 at 15:09:02
    Re: How to convert string dd/mm/yyyy hh:mm to datetime with format dd/mm/yyyy hh:mm

    That is the error I am getting .. my question is how do I do that ?

  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on 14 Feb 2021 at 14:59:45
    Re: How to convert string dd/mm/yyyy hh:mm to datetime with format dd/mm/yyyy hh:mm

    @Anonymous  As clear from error message your date is not in ISO 8601 format. you may need to break it apart and rearrange it to the correct formatting to use it as a DateTime string. Make you date in this format- 2021-02-14T11:59:00
    2021-02-14T11:59:00Z
    20210214T115900Z

    Please 'Thumbs Up' the posts that helped you and 'Mark as Solution' if my post answered your question.

    @Hardesh

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - General Discussion

#1
Pstork1 Profile Picture

Pstork1 20 Most Valuable Professional

#2
Gprior Profile Picture

Gprior 19

#3
stampcoin Profile Picture

stampcoin 16

Overall leaderboard
Loading started