Skip to main content

How to Add Days to a Date in Power Automate with addDays

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

A due date a week from today, the day before a deadline, the morning after a night shift: addDays() moves a date forward or back by a number of days, and can return the result as just the date.

Syntax​

General form
addDays('<timestamp>', <days>, '<format>'?)

From Microsoft's functions reference:

  • <timestamp> (required): text that contains the date, or a date and time.
  • <days> (required): the whole number of days to add. A negative number subtracts.
  • <format> (optional): the format of the result. Without it, the result is in the format o, yyyy-MM-ddTHH:mm:ss.fffffffK.
  • The result is text: the timestamp plus the days.

Microsoft's examples: addDays('2018-03-15T00:00:00Z', 10) returns 2018-03-25T00:00:00.0000000Z, and addDays('2018-03-15T00:00:00Z', -5) returns 2018-03-10T00:00:00.0000000Z.

The example is Import Old Overtime Timesheet, a flow of the Overtime Timesheet app that reads the rows of an old Excel timesheet. Each row has one Date, a Start and a Finish. When a shift runs past midnight, its finish is on the next day: Aisha Khan's shift on 10 October 2026 ran from 20:00 to 01:30.

Step 1: Add a Day to the Date​

The row's Date reaches the flow as 2026-10-10T00:00:00.000Z (How to Get Excel Dates as Dates, Not Numbers, in Power Automate). One day later, as a date only:

The next day
addDays(items('For_each_old_row')?['Date'], 1, 'yyyy-MM-dd')

Step 2: Add the Day Only When Needed​

A shift that ends earlier in the day than it started has crossed midnight. The flow's Compose named Finish date chooses between the next day and the same day (How to Use the if() Function in Power Automate, How to Use the less() Function in Power Automate):

Finish date → Inputs
if(less(formatDateTime(items('For_each_old_row')?['Finish'], 'HH:mm'), formatDateTime(items('For_each_old_row')?['Start'], 'HH:mm')), addDays(items('For_each_old_row')?['Date'], 1, 'yyyy-MM-dd'), formatDateTime(items('For_each_old_row')?['Date'], 'yyyy-MM-dd'))

Both answers are in the same format, yyyy-MM-dd, so the next step can use either the same way. Code view shows the expression as saved:

The Code view of Finish date: type Compose and inputs @if(less(formatDateTime(items('For_each_old_row')?['Finish'], 'HH'), formatDateTime(items('For_each_old_row')?['Start'], 'HH')), addDays(items('For_each_old_row')?['Date'], 1, 'yyyy-MM-dd'), formatDateTime(items('For_each_old_row')?['Date'], 'yyyy-MM-dd'))

The Result​

In the test run, Aisha's row of 10 October, 20:00 to 01:30, got the next day:

The Outputs of Finish date in a run: 2026-10-11

The flow then builds the shift's end from it, 2026-10-11 and 01:30, and converts that to UTC (How to Convert Local Time to UTC in Power Automate with convertToUtc).

Common Mistakes​

MistakeWhat happensDo this instead
Leaving out the formatThe result has a time and Z: 2026-10-11T00:00:00.0000000ZAdd 'yyyy-MM-dd'
'yyyy-mm-dd'mm is minutes'yyyy-MM-dd'
A number of days with decimals for hoursThe reference describes <days> as an integeraddHours() or addMinutes()
Adding a day to a time-only valueThe date is 30 December 1899Add the day to the date column

Troubleshooting​

SymptomLikely causeFix
The result is a day early or lateThe days are counted from a different dateCheck the timestamp in the run
A date with T00:00:00 in itNo format givenAdd 'yyyy-MM-dd'
This expression has a problem when you add itThe designer showed it for correct expressions tooSelect Add again (Fixed: "This expression has a problem" in Power Automate)

FAQ​

How do I subtract days?​

Use a negative number: addDays(utcNow(), -7) is a week ago.

Is there an addMonths()?​

Not by that name. addToTime() adds a number of a unit you choose, and the reference lists Month among its units.

Does addDays() know about clock changes?​

It adds whole days to the timestamp it's given. The example adds a day to a date at midnight and works out the time zone afterwards, with convertToUtc().

Conclusion​

addDays(timestamp, days, format) moves a date by whole days, forward or back, and 'yyyy-MM-dd' returns just the date. With if() and less(), it gives a night shift the right finish date.

Additional Resources​