php date时间的获取

1.得到当前时间:date('Y-m-d H:i:s',time());

2.得到这个月有多少天:echo $getDay = date('t',date('Y-m-d', time())); 

3.得到上周:date("Y-m-d H:i:s",strtotime("-7 day"));

4.得到每个月1号和31号的时间:

$date['start'] = date("Y-".$month."-01 00:00:00");
$date['end'] = date("Y-".$month."-31 23:59:59");
原文地址:https://www.cnblogs.com/kobigood/p/4195762.html