$ts1=strtotime("last saturday of november 2024"); #Timestamp1
$ts2=strtotime("+1 day",$ts1); #Timestamp2
echo "Last Saturday: ".date("d.m.Y",$ts1); #30.11.2024
echo "Last Sunday: ".date("d.m.Y",$ts2); #01.12.2024
With the PHP code above, i get the date of the last saturday and last sunday of november 2024.
But that is not a FULL weekend, because sunday is from the first of december!
So i need the weekend before, witch is a full weekend in the same month -> 23+24. November 2024.
Same problem if i need the first full weekend, witch is not ok in month september 2024, because first of september is a sunday! To be a full weekend, the first weekend must be 7+8. September.
In month october, all is ok, because last full weekend is at date 26+27, so saturday and sunday are not separated.
I can’t find a function in PHP doing that!
Any help?