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 : TA5veopYTgXRmNd88LfPgv
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?

 

 

 

I have the same question (0)
  • 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

  • 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 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

     

     

  • Verified answer
    jinivthakkar Profile Picture
    4,181 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.

     

     

  • 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

  • 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 !!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard
Loading complete