獲取上月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'));