$startweek = "本周开始时间:".date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-date("w")+1-7,date("Y")));

$endweek = "本周结束时间:".date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-date("w")+7-7,date("Y")));

echo $startweek;

echo "<br>";

echo $endweek;

echo "<br>";

$startmonth = "本月开始时间:".date("Y-m-d H:i:s",mktime(0,0,0,date("m"),1,date("Y")));

$endmonth = "本月结束时间:".date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("t"),date("Y")));

echo $startmonth;

echo "<br>";

echo $endmonth;

echo "<br>";

$startlastmonth = "上月开始时间:".date("Y-m-d H:i:s",mktime(0,0,0,date("m")-1,1,date("Y")));

$endlastmonth = "上月结束时间:".date("Y-m-d H:i:s",mktime(23,59,59,date("m"),0,date("Y")));

echo $startlastmonth;

echo "<br>";

echo $endlastmonth;

echo "<br>";

$starttime = "最近七天:".date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-7,date("Y")));

$endtime = "最近30天:".date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-30,date("Y")));

echo $starttime;

echo "<br>";

echo $endtime;

echo "<br>";

$quarter = ceil((date('n'))/3);//当月是第几季度

//echo '本季度:<br>';

echo "本季度开始时间:".date('Y-m-d H:i:s', mktime(0, 0, 0,$quarter3-3+1,1,date('Y'))),"<br>";

echo "本季度结束时间:".date('Y-m-d H:i:s', mktime(23,59,59,$quarter3,date('t',mktime(0,0,0,$quarter*3,1,date("Y"))),date('Y'))),"<br>";