可能重复:
Timestamps of start and end of month如何找到一个前一个月的开始和结束日期在PHP
我想找到上月在PHP的开始和结束日期(即)我想找到当月最后一个月的开始和结束日期
可能重复:
Timestamps of start and end of month如何找到一个前一个月的开始和结束日期在PHP
我想找到上月在PHP的开始和结束日期(即)我想找到当月最后一个月的开始和结束日期
echo date('m-01',strtotime('last month')) . '<br/>';
echo date('m-t',strtotime('last month')) . '<br/>';
尼斯的答案,就可以得到当月的开始和结束日也:'$ FROM日期=日期(“YM- 01',strtotime('this month')); \t \t $ toDate = date('Y-m-t',strtotime('this month'));' – 2017-11-09 10:31:00
我想这会做
echo date('Y-m-d', strtotime('first day of last month'));
echo "<br/>";
echo date('Y-m-d', strtotime('last day of last month'));
似乎是一个笑话,但它确实有效!魔法! – joseantgv 2017-11-06 15:33:08
http://stackoverflow.com/search?q=%5Bphp%5D+date+month – fabrik 2011-04-04 06:52:03