When I run the following code, I get the 30th of April rather than the 27th.
strtotime("Last Friday April 2012");
I tried running it as a Thursday instead and I got back the 29th.
All the following work fine.
strtotime("First Sunday February 2012");
strtotime("Third Monday February 2012");
strtotime("Second Monday October 2012");
strtotime("Fourth Thursday November 2012");
Any ideas?
I believe you are getting back the 30th of March, rather than of April, correct?
Last Friday April 2012does the following:April 2012sett the date to 2012-04-01Last Fridaytakes the date to the previous (last) Friday which is 2012-03-30If you want the last Friday in April, use
Last Friday May 2012instead,See Date/Time – Relative Formats from the PHP manual.