将天数添加到日期我想将天数添加到当前日期:我使用以下代码:$i=30;echo $date = strtotime(date("Y-m-d", strtotime($date)) . " +".$i."days");但我没有得到合适的约会,而是得到了这个:2592000请建议。
3 回答

ABOUTYOU
TA贡献1812条经验 获得超5个赞
function addDayswithdate($date,$days){ $date = strtotime("+".$days." days", strtotime($date)); return date("Y-m-d", $date);}

收到一只叮咚
TA贡献1821条经验 获得超4个赞
$date = new DateTime();$date->modify('+1 week');print $date->format('Y-m-d H:i:s');
print date('Y-m-d H:i:s', mktime(date("H"), date("i"), date("s"), date("m"), date("d") + 7, date("Y"));
- 3 回答
- 0 关注
- 284 浏览
添加回答
举报
0/150
提交
取消