Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
根据PHP 文档,我正确使用了 strtotime,但显然我已经设法弄错了。
以下代码:
echo date("Y,n,j", strtotime($event["StartDate"]));
输出:(2013,4,18这是正确的)
2013,4,18
而以下代码(使用完全相同的数据):
echo date("Y,n,j", strtotime('-1 month', $event["StartDate"]));
输出:(1969,12,1而不是2013,3,18)
1969,12,1
2013,3,18
为什么?
echo date("Y,n,j", strtotime('-1 month', strtotime($event["StartDate"])));