本来应写作
echo date('Y-m-d', strtotime('last month first day'));
echo date('Y-m-d', strtotime('last month last day'));
不过似乎我的php5.4.20有bug
那就写作
echo date('Y-m-01', strtotime('-1 month'));
echo date('Y-m-t', strtotime('-1 month'));
吧
echo date('Y-m-d', strtotime('last month first day'));
echo date('Y-m-d', strtotime('last month last day'));
不过似乎我的php5.4.20有bug
那就写作
echo date('Y-m-01', strtotime('-1 month'));
echo date('Y-m-t', strtotime('-1 month'));
吧
http://blog.csdn.net/timecolor/article/details/12646211
<?php
echo date('Y-m-d',mktime(0,0,0,date('m')-1,1,date('Y'))).'<br>';
echo date('Y-m-d',mktime(0,0,0,date('m'),0,date('Y')));
?>
echo date('Y-m-t', strtotime('-1 month'));
这个最方便·