PHP strtotime epoch timestamp 可能的错误


PHP strtotime epoch timestamp possible bug

据我所知,UNIX纪元从01-01-1970 00:00开始。

那么为什么

echo strtotime('01-01-1970 00:00');返回-3600

我使用的是PHP版本5.6.15和CodeIgniter 3.0.4。我也试过使用/不使用

setlocale(LC_ALL, 'IND');

检查时区设置,看看是否是原因:

echo date_default_timezone_get();

如果不是 UTC ,请将其设置为 UTC

date_default_timezone_set("UTC");