Power Automate: Adding Days to Expiry Date

Power Automate: Adding Days to Expiry Date

Managing expiry dates is a common requirement in business applications. Organizations frequently need to calculate renewal dates, contract expiration dates, warranty periods, subscription validity, and license expiration schedules.

Power Automate provides the addDays() function, which allows users to automatically add a specific number of days to a date and generate future expiry dates without manual calculations.

What is addDays() Function?

The addDays() function adds a specified number of days to a given date and returns the calculated result.

addDays(
StartDate,
NumberOfDays
)

Business Scenario

Suppose a customer subscription starts on January 1st and remains active for 30 days. Power Automate can automatically calculate the expiry date by adding 30 days to the subscription start date.

Syntax

addDays(
'2025-01-01',
30
)

Example 1: Add 30 Days

addDays(
utcNow(),
30
)

Returns a date that is 30 days ahead of the current date.

Example 2: Format Expiry Date

formatDateTime(
addDays(
utcNow(),
30
),
'dd-MM-yyyy'
)

Returns a formatted expiry date.

Common Use Cases

Important: Always use formatDateTime() when displaying calculated expiry dates to users for better readability.

Benefits

Key Takeaways