Get the difference between two dates Power Automate

Let’s take a scenario where the bot needs to verify the input date and if the difference between the input date and today’s date is one then it needs to process further.

In this article, for the above-mentioned scenario, the bot needs to get the difference between two dates.

We are going to achieve this task using Power Automate Desktop.

Let’s get into the practical implementation of this task:

Step1: Drag and Drop Get current date and time action from the actions panel to the flow designer panel to get the CurrentDateTime.

Not sure of this action then read more about this in the below article:

This is the first input date for this example.

Step2: Drag and Drop Add to DateTime action from the actions panel to the flow designer panel to get the second date but it is a day less than the current DateTime.

Not sure of this action then read more about this in the below article:

This is the second input date for this example.

Step3: Drag and Drop Subtract dates action from the actions panel to the designer panel as shown below:

get the difference between two dates

Here:

  • From date – Provide the first input date i.e, the input given to this parameter should be the highest date compared to Subtract date.
  • Subtract date – Provide the second input date
  • Get difference in – Based on which parameter it need to give the difference between two dates.

It can give the difference between two dates based on the below-mentioned parameter:

  • Seconds
  • Minutes
  • Hours
  • Days

Step4: The output of the above flow is shown below:

get the difference between two dates

Here, in this example, the time difference between the first date and second date is one day and this can also be calculated in Seconds, minutes, and hours based on the requirement of business process automation.

Happy Learning!

Like this post then let your friends know about this-:

Leave a Reply

Your email address will not be published. Required fields are marked *