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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Given a certain year (...
Power Automate
Answered

Given a certain year (eg: 2022), how to get a sequence of all days, from the 1st (01-01-2022) till the last (31-12-2022)?

(0) ShareShare
ReportReport
Posted on by 2,297

Given a certain year (eg: 2022), how to get a sequence of all days, from the 1st (01-01-2022) till the last (31-12-2022)?

Categories:
  • Verified answer
    David_MA Profile Picture
    15,705 Super User 2026 Season 2 on at

    The attached flow should give you what you need. You will need to account for leap years or just change the Do Until action to 366. For non-leap years you'll get January 1 for the year specified and for the following year. You will also need to do some extra steps to get the dates in the format you specify above, as this flow generates them in ISO8601 format which is needed to increment the date by one. It takes less than five minutes to run and produces:

    [
      "2023-01-01",
      "2023-01-02",
      "2023-01-03",
      "2023-01-04",
      "2023-01-05",
      "2023-01-06",
      "2023-01-07",
      "2023-01-08",
    ... 
     "2023-12-30",
      "2023-12-31"
    ]
  • David_MA Profile Picture
    15,705 Super User 2026 Season 2 on at

    I added logic to the flow to account for leap years. Now no matter what year is specified, it will generate the correct output for both leap years and non-leap years.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 271

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard