strtotime function for year 2022 First Friday not working

Viewed 42

For year 2022 the strtotime "first Friday" query does not work when first Friday is first day of month.

E.G. For 2022 month equal 7:

$result = date("Y-n-j", strtotime('first Friday 2022-7');

returns string equal 2022-7-8 vs 2022-7-1. For the "first day" the query returns string equal 2022-7-2 A similar wrong result occurs for month equal 4

What am I doing wrong? I am using PHP 7.3.33

0 Answers
Related