Subtract dates Action(Power Automate Desktop)
This action obtains the difference between two dates in days, hours, minutes, or seconds.
How to use.
From "Date time" under "Actions",Drag "Subtract dates".

Set Parameters.

Parameters
From date / Subtract date
Specify the result of the "Get current date and time" action or a fixed date as the date to be calculated.
How the difference is calculated is explained in the next section on the "Get Difference in" parameter.

Get difference in
Specifies in which units the results are calculated. Choose from Days, Hours, Minutes, or Seconds.

Variables produced
TimeDifference
The calculation results are stored.

The result is calculated by "From Date" - "Subtract date".
From date | 4/18/2021/ |
Subtract date | 4/20/2021 |
Get difference in | Days |
TimeDifference | -2 |
If the "source date" is in the future, the result will be a positive number; if it is in the past, the result will be a negative number.
If the calculation is performed on a "day," the result will be a decimal if it includes hours, minutes, and seconds.
From date | 2021/4/18 12:00:00 |
Subtract date | 2021/4/20 00:00:00 |
Get difference in | Days |
TimeDifference | -1.5 |
If this is what you intended, this is fine, If you only want to calculate the day, you can use the " Get current date and time" action to get only the date, or truncate the time of day.
For those who want to learn Power Automate Desktop effectively
The information on this site is now available in an easy-to-read e-book format.
Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.
By the end of this book, you will be equipped with the knowledge you need to use Power Automate Desktop to streamline your workflow.
Discussion
New Comments
No comments yet. Be the first one!