note 24259 added to function.date
| From: | kangus at NOSPAMacats dot com | Date: | Sun, 11 Aug 2002 00:30:27 +0000 |
| Subject: | note 24259 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34792@lists.php.net to get a copy of this message | ||
<?
//Function to return the number of days left before a given date, "How many days until Election
Day?"
function daysLeft($futureDate){
return $DaysTillElection=(date("z",strtotime ($futureDate))-(Date("z")));
}
echo daysLeft("05 November 2002");
// the same in one line: $DaysTillElection=(date("z",strtotime ("05 November
2002"))-(Date("z")));
?>
--
http://www.php.net/manual/en/function.date.php
http://master.php.net/manage/user-notes.php?action=edit+24259
http://master.php.net/manage/user-notes.php?action=delete+24259
http://master.php.net/manage/user-notes.php?action=reject+24259