How to ignore time while comparing with current date in Power Automate

This one is pretty simple blog but pretty useful. And a requirement which is common across implementations. So I decided to share with my blog readers.

In this blog I am going to discuss about the following requirements.

  • How can you compare dates only with date value in Power Automate?
  • How can you ignore time while comparing with the current date in Power Automate?

For this example, I take a simple requirement. I have used the Account entity of CDS and there is a field on Account called Verification date. The requirement is whenever an account is created, if the verification date is within couple of days from the created date, there is a expedited approval process which need to be triggered.

So let’s get started. To get started this is our flow.

Pretty simple right. I check if Verification date falls between today and next day. I checked if the Verification date is between utcNow() and utcNow() + 1 day.

While this will work, it’s not the correct formulae. The reason for this is because utcNow() returns the time component as well. So if the user selects the verification date say 8 AM today and utcNow() is 11 AM, then this condition will evaluate to false. And hence the logic shall be skipped.

This problem can be solved through very small tweak. We are going to ignore the time component from utcNow() and then compare it with the verification date.

Inside utcNow() function you can provide a formatter. And inside the formatter, I choose the year, month and day and completely ignore the time component.

And now my flow works just fine.

Hope this helped!

You will also like the below posts

Debajit Dutta
Business Solutions MVP