php 常用函數

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章