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 / First day of the year ...
Power Automate
Unanswered

First day of the year and last day of the month

(0) ShareShare
ReportReport
Posted on by 12

Is there a way to obtain the first day of the year and last day of the month from the Get Current date and time tool?

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Here's a sample of a GETDATES subflow I keep in almost all my flows and adjust as needed:

     

    MichaelAnnis_0-1633368044100.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @lipster26 

     

    You can use actions "Convert datetime to text", "Convert text to datetime" and "Add to datetime" for this kind of purpose.

     

    Please refer my sample flow in screenshot and code snippet below:

     

     

    shindomo_0-1633373683645.png

     

    DISABLE Text.ToDateTime Text: $'''2021-05-31''' DateTime=> CurrentDate
    DateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateOnly CurrentDateTime=> CurrentDate
    # The first day of the year
    Text.FromCustomDateTime DateTime: CurrentDate CustomFormat: $'''yyyy-01-01''' Result=> FirstDayOfTheYearText
    Text.ToDateTime Text: FirstDayOfTheYearText DateTime=> FirstDayOfTheYear
    # The last day of the month
    DateTime.Add DateTime: CurrentDate TimeToAdd: 1 TimeUnit: DateTime.TimeUnit.Months ResultedDate=> NextMonthOfToday
    Text.FromCustomDateTime DateTime: NextMonthOfToday CustomFormat: $'''yyyy-MM-01''' Result=> FirstDayOfNextMonthText
    Text.ToDateTime Text: FirstDayOfNextMonthText DateTime=> FirstDayOfNextMonth
    DateTime.Add DateTime: FirstDayOfNextMonth TimeToAdd: -1 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> LastDayOfThisMonth
    # Display result
    Display.ShowMessage Message: $'''%FirstDayOfTheYear%
    %LastDayOfThisMonth%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed

     

    Thank you.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 238 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 225

#3
Haque Profile Picture

Haque 181

Last 30 days Overall leaderboard