当我删除一个月时,strtotime回归1970年?

时间:2013-05-08 14:43:14

标签: php strtotime

根据PHP documentation,我正确地使用了strtotime,但显然我设法弄错了。

以下代码:

echo date("Y,n,j", strtotime($event["StartDate"]));

输出:2013,4,18(这是正确的)

以下代码(使用完全相同的数据):

echo date("Y,n,j", strtotime('-1 month', $event["StartDate"]));

输出:1969,12,1(而不是2013,3,18

为什么?

1 个答案:

答案 0 :(得分:4)

echo date("Y,n,j", strtotime('-1 month', strtotime($event["StartDate"])));

相关问题