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 Apps / Get the second sunday ...
Power Apps
Answered

Get the second sunday date of march for the current year

(1) ShareShare
ReportReport
Posted on by 172

I am trying to get the date for second Sunday of march month

 

Set(
    varmarchsecondsunday,
    Date(
        Year(Today()),
        3,
        Day(2)
    )
)
 
i get the 31 of the current year.
Categories:
I have the same question (0)
  • Verified answer
    poweractivate Profile Picture
    11,078 Most Valuable Professional on at

     

    // Set the year and month for which you want the second Sunday
    Set(gloYear, 2024);
    Set(gloMonth, 3); // Example: March 2024
    
    // Calculate the first day of the month
    Set(gloFirstDayOfMonth, DateValue(gloYear & "-" & gloMonth & "-1"));
    
    // Determine the day of the week for the first day of the month (0=Sunday, 1=Monday, ..., 6=Saturday)
    Set(gloFirstDayOfWeek, Weekday(gloFirstDayOfMonth) - 1);
    
    // Calculate the second Sunday
    // If the first day is Sunday, the second Sunday will be 7 plus the first day of month, otherwise calculate the second Sunday by adding the number of days needed
    Set(gloSecondSunday, 
     If(
     gloFirstDayOfWeek = 0,
     DateAdd(gloFirstDayOfMonth, 7, TimeUnit.Days),
     DateAdd(gloFirstDayOfMonth, 14 - gloFirstDayOfWeek, TimeUnit.Days)
     )
    );
    
    Set(
     varmarchsecondsunday,
     gloSecondSunday
    )

     

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard