Subtract from a date
Power Automate Desktop has an action called “Subtract dates,” but what it actually does is convert the difference between two datetime variables into a unit of your choice, so you can’t use it to go back a specified period from a given date.
This article explains how to subtract days, months, or years from a date you have retrieved (that is, how to go back in time).
The short answer
Section titled “The short answer”The action used here is called “Add to datetime.”
Even though it says “add,” you can subtract by adding a negative value.
There’s also an action called “Subtract dates,” but strictly speaking, it gets the difference between two datetimes in seconds, minutes, hours, or days.
Details of the “Add to datetime” action
Section titled “Details of the “Add to datetime” action”The action has the following parameters.
| Parameter | Value |
|---|---|
| Datetime | The base datetime for the addition (such as a Datetime variable) |
| Add | The amount to add (the number of years if you choose years in “Time unit”) |
| Time unit | The unit to add (seconds, minutes, hours, days, months, or years) |

Implement by copying and pasting
Section titled “Implement by copying and pasting”As a sample, I prepared a flow that gets the current date and calculates the date 10 days before it. The last line uses the “Subtract dates” action to find the difference between the two datetimes (10 days).
Copy the following code and paste it into the Power Automate Desktop flow designer to add the actions.
DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateAndTime CurrentDateTime=> CurrentDateTimeDateTime.Add DateTime: CurrentDateTime TimeToAdd: -10 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> ResultedDateDateTime.Subtract FromDate: CurrentDateTime SubstractDate: ResultedDate TimeUnit: DateTime.DifferenceTimeUnit.Days TimeDifference=> TimeDifferenceImplement in Power Automate Desktop
Section titled “Implement in Power Automate Desktop”-
In “Search actions,” type “Add to datetime.”
-
Set the parameters as follows.
Parameter Value Datetime %CurrentDateTime% Add -10 Time unit Days -
When you run the flow, the datetime 10 days before the specified date is stored in a new variable (default: ResultedDate).
Possible exceptions
Section titled “Possible exceptions”This action doesn’t throw any exceptions.