I am working on a PHP function that computes holidays:
function holidays($country = 1, $timespan_start = 0, $timespan_end = 0)
Holidays are returned as timestamps in the array.
Since I need to calculate dates like on the first Monday of February, I tried strtotime("first monday february $year")
, and I found that this did not work in 2010, since 02/01/2010 - Monday - instead I I get February 8th.
This error is mentioned in the change log: In PHP 5 to 5.2.7, a request for a given occurrence of a given day of the week in a month when this day of the week was the first day of the month will incorrectly add one week to the returned timestamp. This has been fixed in 5.2.7 and later.
But I am using PHP 5.3.8. Why am I experiencing this error?
source share