Power Automate AddToTime Function & Action Explained

Power Automate AddToTime Function Action

The Power Automate addToTime function lets you travel to the future. Calculate the date of tomorrow, next week, next month or next year! Within your Power Automate addToTime expressions, you simply provide what time interval you want to add and how often.

There is also the Power Automate Add to time action, which is a little easier to use, but does the same thing.

When should you use the function, and when should you use the function?

I would use the function most of the time, because I like to keep my flows small. Adding the action means another step in your Microsoft flow.

But if your flow is very small or the action is an important step in your flow, go for the action.

In the end, it is a matter of taste.

Power Automate AddToTime Function

Power Automate AddToTime Function 2

The Power Automate addToTime function lets you add time to a given timestamp. (For example 5 minutes, a day, a week, o month or a year)

Syntax

addToTime('<timestamp>', <interval>, '<timeUnit>', '<format>'?)

Input parameters

  • timestamp (mandatory): The timestamp to add time to.
  • interval (mandatory): The time interval that should be used in the addition (Second | Minute | Hour | Day | Week | Month | Year).
  • timeUnit (mandatory): The number of time units for the given interval to be subtracted of the given timestamp.
  • format (optional): A format string to define the output format. (For details, take a look at: How to format date and time in Power Automate)

Return value

  • The timestamp string resulting of the addition, optionally formatted by the given format.

Power Automate AddToTime Expression Examples

Second

// in 5 seconds / add 5 seconds to now
// utcNow() = Monday, August 22, 2022 2:42:36 PM

addToTime(utcNow(),5,'Second','F')
=> Monday, August 22, 2022 2:42:41 PM (example)

Minute

// in 5 minutes/ add 5 minutes to now 
// utcNow() = Monday, August 22, 2022 2:42:36 PM

addToTime(utcNow(),5,'Minute','F')
=> Monday, August 22, 2022 2:47:41 PM (example)

Hour

// in 5 hours/ add 5 hours to now
// utcNow() = Monday, August 22, 2022 2:42:36 PM

addToTime(utcNow(),5,'Hour','F')
=> Monday, August 22, 2022 7:42:41 PM (example)

Day

// in 5 days/ add 5 days to now
// utcNow() = Monday, August 22, 2022 2:42:36 PM

addToTime(utcNow(),5,'Day','F')
=> Monday, August 27, 2022 7:42:41 PM (example)

Week

// in one week / add one week to now
// utcNow() = Monday, August 22, 2022 2:42:36 PM

addToTime(utcNow(),1,'Week','F')
=> Monday, August 29, 2022 2:42:36 PM (example)

Month

// in one month / add one month to now
// utcNow() = Monday, August 22, 2022 2:42:36 PM

addToTime(utcNow(),1,'Month','F')
=> Thursday, September 22, 2022 2:42:36 PM (example)

Year

// in one year / add one year to now
// utcNow() = Monday, August 22, 2022 2:42:36 PM

addToTime(utcNow(),1,'Year','F')
=> Tuesday, August 22, 2023 2:42:36 PM (example)

How To Use Power Automate Add To Time Action

In this example, we add 5 minutes to the current time with the Add to time action. See step-by-step how to use Power Automate Add to time action.

  1. Create a new flow with ‘Manually trigger a flow’

    Power Automate Add to time Action New Flow

    Create new flow

  2. Add a Current Time action step

    Power Automate Add to time Action Add Current Time

    Add current time

  3. Add Add to time action step

    Power Automate Add to time Action Add to time

    Power Automate Add to time action

  4. Power Automate Add to time action configuration

    Power Automate Add to time Action add to time 5 minutes

    Power Automate Add to time action configuration

  5. Do a test run

    Power Automate Add to time Action Test Run

    Result Test Run – Power Automate Add to time action

Leave a Comment

Your email address will not be published.