任何方式在PHP中使用此2013-05-29
这样的日期并获取星期一星期几的日期(格式相同)?所以输出将是这样的:2013-05-27
答案 0 :(得分:7)
date('Y-m-d', strtotime('last sunday +1 day', strtotime('2013-05-29')));
last sunday +1 day
因为last monday
将返回上一个周的星期一,如果$ timestamp实际 星期一已经。
并在第二步中解析原始日期值2013-05-29
,因为所有这些一起作为一个参数不能正常工作(绝对和相对日期值的混合是strtotime不太喜欢的东西)。