note 27429 deleted from function.mktime by sniper
| From: | sniper@php.net | Date: | Tue, 04 Nov 2003 13:11:24 +0000 |
| Subject: | note 27429 deleted from function.mktime by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59879@lists.php.net to get a copy of this message | ||
Note Submitter: jakobi@mainframe.frontbone.de
----
<?
// Change the Dates to meet your needs
$day = 9; // Day of the countdown
$month = 5; // Month of the countdown
$year = 2001; // Year of the countdown
print ("There are " . (int)((mktime (0,0,0,$month,$day,$year) - time(void))/86400) .
" days between today & May 9, 2001");
?>
script from http://www.openconcept.on.ca/guide-countdown.phtml
This how to for a simple counter was posted a few notes above.
You should remind that there is a small logical bug: it cuts the days to an int value, so there
there could be 7,9 days but the script above will cut it down to 7 days. In that situation simply
add 1 to the int value generated by that script.