$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>";
action
本站未注明转载的文章均为原创,并采用
CC BY-NC-SA 4.0授权协议,
转载请注明来源,谢谢!如本站内容对你有所帮助的话,欢迎订阅关注
邢栋博客,唠嗑(分享)每日的折腾经历。
已有 0 条评论