Hope this helps to solve your countdown problems.
PHP Code:
/*
* calculates a countdown to a given date
*
* @package vBulletin
* @author Dominik Hahn, MrNase
* @param unixtime
* @return array
*/
function auctionCountdown($time) {
$difference = $time-time();
$days = floor($difference/86400); # days
$rest = $difference-($days*86400);
$hours = floor($rest/3600); # hours
$rest = $rest-($hours*3600);
$minutes = floor($rest/60); # minutes
$rest = $rest-($minutes*60); # seconds
return array($days, $hours, $minutes, $rest);
}
# EXAMPLE:
$time = auctionCountdown(mktime(0,0,0, 1, 1, 2007));
echo $time['0']. 'days';
echo $time['1']. 'hours';
echo $time['2']. 'minutes';
echo $time['3']. 'seconds';