cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kosenurm
Super User
Super User

Split timestamp to just get the time

Hi, 

 

I am using the Add to Time action successfully in my flow and it returns the accurate date and time as below

 

"2022-08-30T15:05:20.0184281Z"

 

What I want to do is just get the HH:MM:SS values from this string (so "15:05:20") using a compose action - I think I need to split and then trim, but I am getting stuck. Any ideas please?

 

So far I am trying this but getting confused...

 

split(body('Add_to_time'), 'T')

 

Thanks,

K.

2 REPLIES 2
Koen5
Continued Contributor
Continued Contributor

Dear Kosenurm,

 

I believe you can best use the formatDateTime() in the Expression.

Please have a look at: https://docs.microsoft.com/en-us/troubleshoot/power-platform/power-automate/how-to-customize-or-form...

 

If this has helped, please indicate such in the thread as a solution.

Happy flowing,

Koen

okeks
Super User
Super User

You can use the formatDateTime function for this.

 

Here is the documentation: How to customize or format Date and Time values in a flow - Power Automate | Microsoft Docs

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (1,873)