php取上月(上周,上上周,本周)日期

来源:互联网 发布:双代号网络计划规则 编辑:程序博客网 时间:2024/05/22 17:50

简单明了 :

上个月:

$start = date("Ym01", strtotime("last month"));$end   = date("Ym01");
上上周

$start = date("Ymd", strtotime('monday -2 week'));$end   = date("Ymd", strtotime('monday -1 week'));
上周
$start = date("Ymd", strtotime('monday last week'));$end   = date("Ymd", strtotime('monday this week'));


0 0
原创粉丝点击