I want to find the time for first monday after say 10 months, something like this:-
$start = time();
echo date('l jS \of F Y h:i:s A', $start), PHP_EOL;
$start = strtotime('first Monday +10 month', $start);
echo date('l jS \of F Y h:i:s A', $start), PHP_EOL;
The result is:-
Monday 13th of January 2014 08:04:28 AM
Thursday 13th of November 2014 12:00:00 AM
Why is the first string not applied?
I tested this code:
<?php
echo date('l jS \of F Y h:i:s A', strtotime('first monday of +10 month'));
?>
And got the result -- all I had to do was add "of" to the string. Notes on the site indicate this is for >=5.3.
Output:
Monday 3rd of November 2014 12:00:00 AM
Edit Ignore all this BS
It's because you missed the note in the documentation. It applies
Relative statements are always processed after non-relative statements
So, it's going to the first Monday and then going forward 10 months.
Edit: Strike this: Change the order to '+10 months first Monday'
to get what you desire. I misread the note, too. I guess it means you need to do 2 strtotimes in the order you need.