【发布时间】:2012-06-07 02:24:21
【问题描述】:
$somedate = "1980-02-15";
$otherdate = strtotime('+1 year', strtotime($somedate));
echo date('Y-m-d', $otherdate);
输出
1981-02-15
和
$somedate = "1980-02-15";
$otherdate = strtotime('+2 year', strtotime($somedate));
echo date('Y-m-d', $otherdate);
输出
1982-02-15
但是
$somedate = "1980-02-15";
$otherdate = strtotime('+75 year', strtotime($somedate));
echo date('Y-m-d', $otherdate);
输出
1970-01-01
如何解决?
【问题讨论】:
标签: php date strtotime dateadd