php 怎么得到当前时间1个月后时间

就是要把两个月后的时间赋值给$date_two_ms
然后把$date_two_ms插入数据库。。。(类型是date)

<?php
$date_two_ms = date('Y-m-d',strtotime('next month'));
?>

还可以这样,你随便选择一个使用就可以了

<?php

$now = time(); //获取当前的时间戳
$date_two_ms = date('Y-m-d',$now+3600*24*30); //这里使用了30天 你也可以换成 31天什么的

?>
温馨提示:答案为网友推荐,仅供参考
第1个回答  2015-09-22
<?php
$month_date = date('Y-m-d H:i:s',strtotime('+1 month'));
echo $month_date;
?>

第2个回答  2015-09-12
<?php
$date_two_ms = date('Y-m-d',strtotime('next month'));
?>

第3个回答  2011-04-10
需要获得当前时间2个月后的时间 可以使用strftime('+2 month');获得。
strtotime的具体用法请查看php manual
第4个回答  2015-10-27
date("Y-m-d H:i:s",strtotime("next month"));