我有一个代码,但找不到错误在哪里。我有即将举行的活动和当前时间。如果我将我的事件转换为时间戳,那么它小于当前的时间戳。可能是你可以帮助我。PHP Unix时间戳
我下面的代码:
<?php
date_default_timezone_set('Etc/GMT');
$upcoming = "2012.09.05 23:50";
$current = time();
echo "Upcoming: " . $upcoming . " | Timestamp:" . mktime(23, 50, 0, 09, 05, intval(date("Y")));
echo "<br>Current: " . time();
echo "<br>Current SIM: " . mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y"));
?>
将输出:
Upcoming: 2012.09.05 23:50 | Timestamp:1323129000
Current: 1346855221
Current SIM: 1346855220
WHERE CURRENT>即将时间戳。 (???) 谢谢!
是的。此字符串:date_default_timezone_set('Etc/GMT'); – user889349