Reputation: 1357
Today is 2015-05-14
Why does
date('Y-m-d', strtotime('first monday previous month'))
return
string(10) "2015-04-18"
I expected this to return 2015-04-06 - first Monday of previous month.
Upvotes: 1
Views: 128
Reputation: 866
Please try with this..
echo date('Y-m-d', strtotime('First Monday of ' . date("Y-m-d", strtotime("-1 months") ) ));
Upvotes: 0
Reputation: 31749
Missing of
in the datetime
string. Try with -
date('Y-m-d', strtotime('first monday of previous month'));
Upvotes: 2