“I’d like to add exactly one month to a date in Power Automate. Not 30 days but a full month: 28, 29, 30 or 31 days.”
Like many other operations in Power Automate, you must find the right action or expression to add month(s) to a date. You could use the common addDays(…) expression to add a specific number of days, but what number do you use? Do you use 30 as an average for all months? Even if it’s not 30 each month? That could make a difference in days from the desired date.
What’s the action or expression to use then? Actually, there’re both options: action and expression.
Let’s take a look on the expression first. Power Automate has an expression addToTime(…) to add various time units. It expects 4 parameters: date, how many units to add, what time units these are, and format.
addToTime([Date], [number], '[units]', '[format]') example to take today's date, add 12 Months, and format as year-month-date (2021-01-27) addToTime(utcNow(),12,'Month','yyyy-MM-dd') Notes: [Date] is the base date [number] is a number of the [units] to add [units] is the time period: Second, Minute, Hour, Day, Week, Month or Year [format] is optional, it's up to you if you want to format the result in any way
‘Add to time’ action
‘Add to time’ is an action with almost the same functionality. If you don’t want to type in an expression, you can use this action instead.
There’s one downside though, the ‘Add to time’ action doesn’t allow you to format the result date. In case you need the date in a specific format, you must format it later using a separate expression formatDateTime(…).
As you can see above, Power Automate has often multiple solutions to a problem. One solution is using a specific action, it’s simple and user friendly, but you might miss some functionality.
The other solution, with the expression, might look complicated on the first look, but it gives you more possibilities. You don’t depend on the design of a specific action, you have full access to the underlying expression. In this case it’s the result date format.