note 68706 deleted from function.date by bobby
| From: | bobby@php.net | Date: | Thu, 07 Sep 2006 18:09:02 +0000 |
| Subject: | note 68706 deleted from function.date by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-116857@lists.php.net to get a copy of this message | ||
Note Submitter: zzzdobr at gmai dot com
----
If you want to get amount of days between two dates you can use this :
<?php
$d1="2006-08-08";
$d2="2006-08-09";
$today=strtotime($d1); // first date
$yesday=strtotime($d2); // second
$datet = getdate($today);
$datey = getdate($yesday);
$t1=$datet['yday'];
$t2=$datey['yday'];
echo $t0=$t2-$t1; // between my two dates will be '1 day'
echo "<br>".$tt=time()+($t0*86400); // in seconds
?>