note 69387 added to function.date
| From: | michiel at mb-it dot nl | Date: | Mon, 04 Sep 2006 12:59:22 +0000 |
| Subject: | note 69387 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116653@lists.php.net to get a copy of this message | ||
oops, my previous post contained some errors. Here is the right one:
The calculation function of the number of days between 2 dates by zzzdobr at gmai dot com could be
done much easier:
<?
function getdays($day1,$day2)
{
return round((strtotime($day2)-strtotime($day1))/(24*60*60),0);
}
$begin = date("Y/m/d"); // we set today as an example
$end = "2006/11/27";
getdays($begin,$end);
?>
So now all of you know how many days you have left to buy me a birthday present ;)
----
Server IP: 83.137.20.120
Probable Submitter: 80.60.107.176 (proxied: 1.1 BRIMSTONE)
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/69387
Del: integrated -- https://master.php.net/note/delete/69387/integrated
Del: useless -- https://master.php.net/note/delete/69387/useless
Del: bad code -- https://master.php.net/note/delete/69387/bad+code
Del: spam -- https://master.php.net/note/delete/69387/spam
Del: non-english -- https://master.php.net/note/delete/69387/non-english
Del: in docs -- https://master.php.net/note/delete/69387/in+docs
Del: other reasons-- https://master.php.net/note/delete/69387
Reject -- https://master.php.net/note/reject/69387
Search -- https://master.php.net/manage/user-notes.php