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

Remove hour, minute, second from string

Hello,

 

I'm currently working on a Flow which uses data from API and I'm a bit stuck.

 

The flow calls to my API and I parse JSON. Here I get a string called "updated-at". "updated-at" equals a date in this format "2020-07-07T12:03:24.290+02:00"

 

I then have a condition saying if "updated-at" equals formatDateTime(utcNow(),'yyyy-MM-dd') then continue.

 

The problem is Flows is failing here since "updated-at" shows like this: "2020-07-07T12:03:24.290+02:00"

I would need to remove hours, minutes and seconds somehow from "updated-at" for the Flow to work. 

 

I appreciate all help!

Kind regards
Sammy

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Liminity_Sammy,

 

If you want to compare two dates, you should convert them into the same format, for example:

Annotation 2020-07-08 131238.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Mira_Ghaly
Dual Super User
Dual Super User

Hi @Liminity_Sammy

 

 

Have you tried formatting updated at in a compose or variable the same way you are formatting utcnow(), and then do the comparison between ur formatted updated at and the formatted UTC Now.

 

 

IF this solves your problem please mark my reply as a solution 

 

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Hello Mira and thanks for your answer,I'm a bit of a novice here. I dont know hwo to do this. Do I need to change my 

formatDateTime(utcNow(),'yyyy-MM-ddT')? 

 

Hi @Liminity_Sammy,

 

If you want to compare two dates, you should convert them into the same format, for example:

Annotation 2020-07-08 131238.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This works! Thank you very much!!!

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,701)