web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to add one year to...
Power Automate
Unanswered

How to add one year to a current date

(1) ShareShare
ReportReport
Posted on by 441

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?

Categories:
I have the same question (0)
  • Verified answer
    creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @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

     

  • MN003 Profile Picture
    441 on at

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

  • AM-03091305-0 Profile Picture
    31 on at
    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'))
  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at
    ​​​​​​​getFutureTime(1, 'year''yyyy')

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

    add(int(utcNow('yyyy')), 1)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard