Third Thursday - Bug #43452

liderbug

New member
Bug #43452 was opened in 2007. Bug is: if you do "strtotime('third tuesday..." and the first of the month is on a Tuesday you get the fourth Tuesday. or Wed or Thur or... The bug is still there. 16 years later? or did it come back?

A workaround is: if ($day == 22) $day = 15;
 
I would suggest using the more modern DateTime Class.

PHP:
echo (new DateTime('first thursday of October 2020'))->format('Y-m-d');
 
Back
Top