Power Automate provides functions to add time-based on each of the units. For example, you can use the addSeconds Function to add only seconds, but the addToTime Function can provide a lot more flexibility since you define the unit that you want to add.


It follows a simple pattern.

  1. Date
  2. Number to add/remove
  3. Time unit to add
  4. (Optional) Date Format



will return 


Looks quite straightforward, right? Positive numbers add seconds, and negative exclude them.

Please be aware that the reference material, Microsoft names objects like ‘2019-10-28T10:10:00Z’ as timestamps. I prefer calling them “Date” to avoid confusion with the UNIX timestamp, commonly used in APIs, to represent the number of seconds elapsed since Jan 01, 1970 (UTC).


Contrary to SharePoint and PowerApps, there’s no limitation to the date that you can use. You can do things like:


and you'll get 


Dates behave like you’re expecting them.


  1. Always include the format, even if the value is optional. The default value is “yyyy-MM-ddTHH:mm:ss:fffffffK,” but the date provided may not be in the same format returned or even trigger errors. You can define a single format specifier (for example, “o”) or a custom format pattern (for example, “yyyy-MM-dd”), so pick your favorite, but be sure to define it.
  2. I prefer to use individual functions instead of this function. For example, I prefer using the addSeconds Function since it makes the formula quite clear and shorter. It’s a matter of preference since the result will be the same.


Microsoft’s addToTime Function Reference

Back to the Power Automate Function Reference

Featured Image by NeONBRAND on Unsplash

Manuel Gomes

I'm a Project Manager with experience in large projects and companies. I've worked in the past for companies like Bayer, Sybase (now SAP) and I'm currently working for Pestana Hotel Group.

View all posts by Manuel Gomes →

2 thoughts on “Power Automate: addToTime Function

  1. Hello

    Is it possible to do things like “addToTime(‘2018-01-01T00:00:00Z’, -1, ‘Month’)” or will that give you an error?

    Thank you

    1. Hi Daniel,

      Yes it’s correct and it works.

      The only thing that we need to be careful of is the quotes. They need to be straight single quotes for it to work.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: