'first monday previous month' 时间混乱

'first monday previous month' strtotime confusion

今天是 2015-05-14

为什么

date('Y-m-d', strtotime('first monday previous month'))

return

string(10) "2015-04-18"

我预计 return 2015-04-06 - 上个月的第一个星期一。

datetime 字符串中缺少 of。试试 -

date('Y-m-d', strtotime('first monday of previous month'));

Docs

请试试这个..

echo date('Y-m-d', strtotime('First Monday of ' . date("Y-m-d", strtotime("-1 months") ) ));