获取上月1号到最后一天的时间:
echo date('Y-m-01', strtotime('-1 month'));
echo '<br>';
echo date('Y-m-t', strtotime('-1 month'));
和下面的
echo date('Y-m-01 00:00:00', strtotime('-1 month'));
echo '<br>';
echo date('Y-m-t 23:59:59', strtotime('-1 month'));
获取上月1号到最后一天的时间:
echo date('Y-m-01', strtotime('-1 month'));
echo '<br>';
echo date('Y-m-t', strtotime('-1 month'));
和下面的
echo date('Y-m-01 00:00:00', strtotime('-1 month'));
echo '<br>';
echo date('Y-m-t 23:59:59', strtotime('-1 month'));