cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pipo
Frequent Visitor

Date Format YYYY-MM-DDThh:mm:ssZ to DD-MM-YYYY

 

Hi to all,

Picking dates from Excel y get this output YYYY-MM-DDThh:mm:ssZ as you may see in the image.

I need to send an email with that date.

Any idea how to convert the format to DD-MM-YYYY without the time?

Don't know how to use Compose to make it.

I've obtained the desired format inside the Excel creating an extra column an using TEXT function to get the desired format buy I would like to make inside the flow without modifying the Excel file.

Thanks a lot

 

date.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

Actually, the date is in ISO 8601 UTC time zone format.  A formatDateTime() will work just fine without the extra steps.  But be aware Excel using this format was due to a regression bug.  MS is in the process of rolling it back so it will start reporting the Serial date again which will need additional conversion.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

7 REPLIES 7
abm
Super User III
Super User III

Hi @Pipo 

 

Use the formatDateTime() expression.

 

formatDateTime(yourdynamicdatefieldvalue, 'dd/MM/yyyy),



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
abm
Super User III
Super User III

Hi @Pipo 

 

I have realised that the format date you have is not dd-mm-yyyy hh:mm:ss format. So you will struggle to convert using the formatDateTime() expression. Please follow the below steps

 

image.png

 

Above the split compose expression is as follows:

 

split(first(split(outputs('Compose_2'),'T')),'-')
 
Next compose to get the date format in dd-mm-yyyy the expression I used above is as follows:
outputs('Compose')[2]-outputs('Compose')[1]-outputs('Compose')[0]
 
For the above use one outputs each time and click update then manually type the hyphen '-' and do the next output index and so on. 
 
Here is my test result
 
image.png
 


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
Pstork1
Dual Super User III
Dual Super User III

Actually, the date is in ISO 8601 UTC time zone format.  A formatDateTime() will work just fine without the extra steps.  But be aware Excel using this format was due to a regression bug.  MS is in the process of rolling it back so it will start reporting the Serial date again which will need additional conversion.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

abm
Super User III
Super User III

Hi @Pstork1 

 

I did tried initially formatDateTime() and I got the below error. Am I missing anything here?

 

image.png



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
Pstork1
Dual Super User III
Dual Super User III

If you look at the original post you will see that the date was reported with a 'Z' at the end.  That is the way it comes from Excel (At least until MS change the connector back).  The UTC timecode will convert directly using formatdatetime.  How are you getting the time you have in Compose 2?  That appears to come in as a local time zone date time.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
abm
Super User III
Super User III

Hi @Pstork1 

 

Thanks. It was my bad I forgot to add the Z in my compose. I was trying have a quick test against the value which is provided from the screenshot earlier.

 

Thanks

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
Pstork1
Dual Super User III
Dual Super User III

Not a problem.  I didn't notice it either on your post.  That's why I wanted to clarify that extra steps weren't necessary.  But it won't matter since that update is being rolled back and we'll have to go back to calculating date and time from a serial date.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (31,221)