【发布时间】:2009-12-15 11:14:27
【问题描述】:
以下代码
echo $lastmoment."<br/>";
echo time();
echo "<br/>";
echo strtotime($lastmoment);
输出:
2009-12-15 17:40:53 1260876829 1260898853
怎么了? $lastment 是 MySQL 过去的时间戳,为什么 strtotime($lastmoment) 比 time() 大?
【问题讨论】:
-
您能否将以下内容添加到您的代码中,在
echo time()上方:echo $lastmoment;?在使用strtotime()函数转换之前查看值会很有帮助。 -
另外,可能在之前或之后连续多次回显
$lastmoment,以证明它保持不变。谢谢。 -
$lastmoment 保持不变。
-
见安德鲁的回答。您的服务器有两个不同的时钟。
标签: php mysql timestamp strtotime