Хорошо, поэтому я делаю онлайн-текстовую игру, и я застрял прямо сейчас с завершением:
function....
// I can't get this script to execute when I know the time has passed.
$now = new DateTime("now", new DateTimeZone('UTC'));
$row_date = new DateTime($row["due_date"], new DateTimeZone('UTC'));
if ($row_date->format('Y-m-d H:i:s') <= $now->format('Y-m-d H:i:s'))
{
mysql_query(".....")VALUES ("....")or die(mysql_error());
mysql_query("DELETE FROM ......")or die(mysql_error());
}
else
{
// The time has not come yet.
}
Этот код должен выполняться каждые 10 секунд с помощью jQuery setInterval.