note 43828 deleted from function.date by tomsommer
| From: | tomsommer@php.net | Date: | Mon, 05 Jul 2004 16:52:55 +0000 |
| Subject: | note 43828 deleted from function.date by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72615@lists.php.net to get a copy of this message | ||
Note Submitter: Luis Rodríguez rodriguezlopez1@yahoo.com
----
/*This function obtains the difference in days beetween a date and now */
function diff2now($date){
//$date format DD/MM/YYYY
$array_temp=explode("/",$date);
$hoy = mktime(0,0,0,date("m"),date("d"),date("Y"));
$date_temp=mktime(0,0,0,$array_temp[1],$array_temp[0],$array_temp[2]);
$diff_sec=$hoy-$date_temp;
//1 day= 24 hours = 1440 min = 86400 sec
$diff=$diff_sec/86400;
return $diff;
}
//Example: echo diff2now("05/07/2004");