假设我有一个格式如下的日期:2010-12-11(年-周一-日)
使用 PHP,我想将日期增加一个月,并且如果需要,我希望年份自动增加(即从 2012 年 12 月增加到 2013 年 1 月)。
问候。
最佳答案
$time = strtotime("2010.12.11");
$final = date("Y-m-d", strtotime("+1 month", $time));
// Finally you will have the date you're looking for.
关于php - 将日期增加一个月,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2870295/