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 / How to convert string ...
Power Automate
Unanswered

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

(0) ShareShare
ReportReport
Posted on 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?

 

 

 

Categories:
I have the same question (0)
  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @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 at

    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 at

    @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,187 on at

    @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 at

    Thank you Sir, you are a star

  • diegocruzb96 Profile Picture
    22 on at

    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

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard