note 63951 deleted from function.date by bjori
| From: | bjori@php.net | Date: | Tue, 04 Apr 2006 18:08:12 +0000 |
| Subject: | note 63951 deleted from function.date by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-107315@lists.php.net to get a copy of this message | ||
Note Submitter: mpoletto at gmail dot com
Reason: useless
----
Refers to james at bandit dot co dot nz
at 05-Mar-2006 08:27
-------------------------------
That function is simple and good, but need one thing more to work fine. If you don't sum $date1
with 86400 you'll get one incomplete day (24 hours) more.
Do anything like this:
<?php
$date1 = mktime(0,0,0,1,1,2006);
$date2 = mktime(0,0,0,date('m'),date('d'),date('Y'));
$total_days = 0;
while($date1+86400 < $date2)
{
$total_days++;
$date1 += 86400;
}
echo $total_days;
?>
Sds
Marcos