Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

How to add one year to a current date

(1) ShareShare
ReportReport
Posted on by 422

Hello,

 

I have a compose action that gets the current year: formatDateTime(utcNow(), 'yyyy')

 

This works great. What I'm trying to do is use another compose action that adds one year to the year above. So far I have been trying the addtoTime and addDays expressions but have been unsuccessful. 

 

The last one I tried was: addDays(outputs('Compose_5'), 365, 'yyyy')

 

Ultimately, I would like to use these steps to build a condition that says if a folder with the current year does not exist in my SharePoint library, then create a new folder for the new year. So I've created a folder for 2024 but when 2025 arrives and subsequent new years, I would like for the workflow to create the new folder for documents to be populated into. Can anyone help me with any guidance on this?

  • Chriddle Profile Picture
    7,793 Super User 2025 Season 1 on at
    How to add one year to a current date
    ​​​​​​​getFutureTime(1, 'year''yyyy')

    addToTime(utcNow(), 1, 'year', 'yyyy')

    add(int(utcNow('yyyy')), 1)
  • AM-03091305-0 Profile Picture
    31 on at
    How to add one year to a current date
    Please note that the proposed expression of formatDateTime(addDays(utcNow(),365),'yyyy') will not account for leap years. For example, on January 1, 2024, the expression to add 365 days will return "2024" coming from December 31, 2024. To account for this, you can check if the adding of 365 still results in the same year as the current utcNow year using the following expression:
     
    if(equals(formatDateTime(addDays(utcNow(),365),'yyyy'),formatDateTime(utcNow(),'yyyy')),formatDateTime(addDays(utcNow(),366),'yyyy'),formatDateTime(addDays(utcNow(),365),'yyyy'))
  • MN003 Profile Picture
    422 on at
    Re: How to add one year to a current date

    @creativeopinion, this worked perfectly. Thank you! Also, thanks for the helpful YT tutorial link. I'll check that out.

  • Verified answer
    creativeopinion Profile Picture
    10,439 Super User 2025 Season 1 on at
    Re: How to add one year to a current date

    @MN003 

     

    You can use a single expression:

    formatDateTime(addDays(utcNow(),365),'yyyy')

     

    You might be interested in this YT Tutorial: How to Work with 📆 Dates in Power Automate | Example Scenarios and Tips & Tricks

     

    Are you easily stumped when working with Dates in Power Automate? In this Power Automate tutorial, I’ll show you how to compose an expression that will return a future date, a past date, how to count the number of days between two dates, how to check for a birthdate and anniversary date as well as tips and tricks when working with dates in Power Automate.

     

    I’ll cover some common use cases and concepts that can help you to build better Power Automate flows. Feel free to skip ahead using the timestamps listed below. I’ve also linked a few other tutorials that you might be interested in as well.

    IN THIS VIDEO:

    ✅ 4 Date Functions You Need to Know

    ✅ How to use the Convert Time Zone Action

    ✅ How to Get a Future Date

    ✅ How to Get a Past Date

    ✅ How to Return SharePoint Items Due in a Number of Days

    ✅ How to Return SharePoint Items Due within a Date Range

    ✅ How to write a Filter Query for SharePoint Items Due in 30, 60 and 90 Days

    ✅ How to Calculate the Number of Days between Two Dates

    ✅ How to Check for a Birthdate and Anniversary Date

    ✅ How to work with Dates and Times in Excel

    ✅ How to use a Manual Trigger with Date Input

    ✅ How to Output Dynamic Text with an Expression

    ✅ How to Check if a Date Falls on a Weekend

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492