Php 如何添加+;当前日期的6个月
我想在当前日期中添加6个月。我使用了以下日期格式Php 如何添加+;当前日期的6个月,php,date,Php,Date,我想在当前日期中添加6个月。我使用了以下日期格式 $current_time = date('Y-m-d'); 我已继续使用下面所示的方法,但出现了错误 “遇到格式不正确的数值”。 并打印此值 [到期计划日期]=>1970-01-02 $data['PlanPayment']['expiring_plan_date'] = date (
$current_time = date('Y-m-d');
我已继续使用下面所示的方法,但出现了错误
“遇到格式不正确的数值”。
并打印此值[到期计划日期]=>1970-01-02
$data['PlanPayment']['expiring_plan_date'] = date
(
"Y-m-d",
strtotime("+6 month", $current_time)
);
请帮助..从
strotime
$data['PlanPayment']['expiring_plan_date'] = date("Y-m-d", strtotime("+6 month $current_time));
日期(“Y-m-d”,标准时间(“6个月”)代码>就用这个谢谢..是的,它工作得很好..我的错误是采用了错误的格式。