日期:2014-05-16 浏览次数:20492 次
echo date("Y-m-d\n",strtotime("$s+7 month"));得到 2014-03-03
select adddate('2013-07-31', INTERVAL 7 month)得到 2014-02-28
$t = '2013-07-31';
echo date("Y-m-d",mktime(0,0,0,date("m") + 12,date("d") , date("Y"))).'<br>';
echo date("Y-m-d",mktime(0,0,0,date("m") + 3,date("d") , date("Y"))).'<br>';
echo date("Y-m-d",mktime(0,0,0,date("m") + 1,date("d") , date("Y"))).'<br>';
2014-07-31
2013-10-31
2013-08-31
$t = '2013-07-31';
echo date("Y-m-d",mktime(0,0,0,date("m") + 2,date("d") , date("Y")));