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?
@creativeopinion, this worked perfectly. Thank you! Also, thanks for the helpful YT tutorial link. I'll check that out.
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
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492