Reoccuring PHP Countdown

Hi All,

I am creating just a basic countdown that will reoccur after the time has been reached. Here is my current code:

[php]<?php
$offset = strtotime("+12 hours");
$currenttime = date(“H:i:s”, $offset);
$goaltime = “12:56:00”;

echo "
Current Time: $currenttime

Target time: $goaltime


";

echo “”;

if($currenttime>=$goaltime)
{
echo “THIS WILL DISPLAY AT THE TIME”;
}
?>[/php]

The offset is just so it will be displayed in my local time, so how would I be able to have this to repeat from say 20:00:00 to countdown to 17:15:00 the next day?

Thanks in advance! :slight_smile:
James

EDIT: PHP code is actually this:

[php]

<?php $offset = strtotime("+12 hours"); $currenttime = date("H:i:s", $offset); $goaltime = "17:15:00"; echo " Current Time: $currenttime
Target time: $goaltime

"; echo ""; if($currenttime>=$goaltime) { echo "THIS WILL DISPLAY AT THE TIME"; } ?>

[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service