Learn how to add days in power automate! In this document we explain the Power Automate addDays function.
See how to use addDays In Power Automate in a step-by-step guide. Last but not least, we address so common questions on the Power automate addDays function.
Power Automate AddDays Function
The Power Autmate addDays function adds a given number of days to a timestamp and optionally formats the result by a given format.
addDays('<timestamp>', <days>, '<format>'?)
- timestamp (mandatory): The timestamp which used as basis for the addition of days.
- days (mandatory): The number of days to be added.
- format (optional): A format string to defines the format of the result. For details check out: How to format date and time in Power Automate
- The result of adding days to the given timestamp. In case there is format provided, it will format the result accordingly.
Power Automate addDays expression example
How To Use addDays In Power Automate
In this guide, we add one day to utcNow function result. We set the date on tomorrow at the same time.
Create a new Power Automate flow with ‘Manually trigger a flow’ trigger.
New Microsoft flow
Add new step by clicking on ‘+ New Step’
Add a new step
Search for ‘initalize’ and select ‘Initialize variable’
Add Initialize variable step
Set Initialize variable Name ‘now’, Type ‘String and Value ‘utcNow()’ via Expression editor
Set variable to utcNow
Add a compose step by searching for ‘compose’ and clicking on ‘Compose’
New Compose step
Set input of Compose action to ‘addDays(variables(‘now’),1)’ via expression editor
Power Automate addDays expression
Here is the Power Automate addDays expression for copy & paste.
Examples – Power Automate addDays Function Expression
Does Power Automate addDays work with negative numbers?
Yes, it does. Despite the function name, the following example is actually subtracting 10 days.