note 27429 added to function.mktime

From: Date: Thu, 05 Dec 2002 16:51:09 +0000
Subject: note 27429 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-40384@lists.php.net to get a copy of this message
<? // 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. -- http://www.php.net/manual/en/function.mktime.php http://master.php.net/manage/user-notes.php?action=edit+27429 http://master.php.net/manage/user-notes.php?action=delete+27429 http://master.php.net/manage/user-notes.php?action=reject+27429

« previous php.notes (#40384) next »