我有一个变量叫做$effectiveDate
包含日期2012-03-26.
我试图在此日期基础上增加三个月,但没有成功。
这是我尝试过的:
$effectiveDate = strtotime("+3 months", strtotime($effectiveDate));
and
$effectiveDate = strtotime(date("Y-m-d", strtotime($effectiveDate)) . "+3 months");
我究竟做错了什么?这两段代码都不起作用。
将其更改为这样将为您提供预期的格式:
$effectiveDate = date('Y-m-d', strtotime("+3 months", strtotime($effectiveDate)));
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)