strtotime&;1345810203的日期()中


wrong conversion in strtotime & in date() for 1345810203

我想存储开始时间&结束时间,并计算两次之间的总时间差。有一段时间,由于这个问题,我得到了像-1 min -24 sec这样的负面时间。。。

如果我是回显这个代码

date('Y-m-d h:m:s',1345810203);

我得到的答案是2012-08-24 02:08:03,但我回显了这个代码

strtotime('2012-08-24 02:08:03');

我得到的答案是1345766883

如果时间是13458101671345810187,则在strtotime&date()。

问题出在哪里?

您的格式错误。

mNumeric representation of a month, with leading zeros

iMinutes with leading zeros

使用以下格式:

'Y-m-d h:i:s'

参考编号:http://php.net/manual/en/function.date.php