note 10911 deleted from function.date by jimw
| From: | jimw@php.net | Date: | Fri, 02 Nov 2001 00:53:51 +0000 |
| Subject: | note 10911 deleted from function.date by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20073@lists.php.net to get a copy of this message | ||
The countdown code by tom_g@execpc.com seems a little overkill to my taste, so I'm adding a
simple way to count down days hours.mins.secs
Example: Count down to the new year 2002.
$timeleft = mktime(0,0,0,1,1,2002) - time();
// separate days from hours minutes and seconds...
$hms = $timeleft % 86400;
$days = ($timeleft - $hms) / 86400;
echo $days . " " . date("H.i.s", mktime(0,0,$hms));