I'll admit, I am not a PHP expert but I thought I could figure this countdown code out, guess not..
Here is the source/original code:
PHP:--------------------------------------------------------------------------------
<?
$day = 1; // Day of the countdown
$month = 1; // Month of the countdown
$year = 2010; // Year of the countdown
// mktime is the marked time, and time() is the current time.
$target = mktime(0,0,0,$month,$day,$year);
$diff = $target - time();
$days = ($diff - ($diff % 86400)) / 86400;
$diff = $diff - ($days 86400);
$hours = ($diff - ($diff % 3600)) / 3600;
$diff = $diff - ($hours 3600);
$minutes = ($diff - ($diff % 60)) / 60;
$diff = $diff - ($minutes * 60);
$seconds = ($diff - ($diff % 1)) / 1;
printf("There are $days days, $hours hours, $minutes minutes, $seconds seconds until the target date and time");
?>
and now here is the code I have...
PHP:--------------------------------------------------------------------------------
<?
$day = 13; // Day of the countdown
$month = 5; // Month of the countdown
$year = 2002; // Year of the countdown
// mktime is the marked time, and time() is the current time.
$target = mktime(0,0,0,$month,$day,$year);
$diff = $target - time();
$days = ($diff - ($diff % 86400)) / 86400;
$diff = $diff - ($days 86400);
$hours = ($diff - ($diff % 3600)) / 3600;
$diff = $diff - ($hours 3600);
$minutes = ($diff - ($diff % 60)) / 60;
$diff = $diff - ($minutes * 60);
$seconds = ($diff - ($diff % 1)) / 1;
printf("There are $days days, $hours hours, $minutes minutes, $seconds seconds until the 50% off sale ends!");
?>
I want it to countdown to May 13, 2002 at 4 pm EST.
I am unsure of how to do this and I changed the date at the top and right away I'm getting the following error:
Warning: printf(): too few arguments in /usr/local/psa/home/vhosts/webguyz.ws/httpdocs/countdown.php on line 19
Any ideas?