PHP-获取上周一周的日期
程序员文章站
2022-05-15 10:59:31
...
$start1 = date("Y-m-d", strtotime('monday last week'));
$end1 = date("Y-m-d", strtotime('monday this week - 1 days'));
$start2 = date("Y-m-d", strtotime('monday -3 week'));
$end2 = date("Y-m-d", strtotime('monday -2 week - 1 days'));
$start3 = date("Y-m-d", strtotime('monday -4 week'));
$end3 = date("Y-m-d", strtotime('monday -3 week - 1 days'));
$start4 = date("Y-m-d", strtotime('monday -5 week'));
$end4 = date("Y-m-d", strtotime('monday -4 week - 1 days'));
echo " 1: $start4\n";
echo " : $end4\n";
die;
上个月:
$start = date(“Ym01”, strtotime(“last month”));
$end = date(“Ym01”);
上一篇: 获取上周一周日,本周一周日,下周一周日
下一篇: 获取最近几个月的日期集合