时间:2021-07-01 10:21:17 帮助过:27人阅读
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"))).'
';
echo date("Y-m-d",mktime(0,0,0,date("m") + 3,date("d") , date("Y"))).'
';
echo date("Y-m-d",mktime(0,0,0,date("m") + 1,date("d") , date("Y"))).'
';
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")));