'第一个星期一前一个月' 的strtotime混乱

问题描述:

今天是2015年5月14日'第一个星期一前一个月' 的strtotime混乱

为什么

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

回报

string(10) "2015-04-18" 

我预计今年重返2015年4月6日 - 上个月的第一个星期一。

+1

这是因为前一个月是'2015-04-14',加上之前'以前month''of'。 – panther

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"))));