note 43828 added to function.date

From: Date: Mon, 05 Jul 2004 16:00:27 +0000
Subject: note 43828 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-72613@lists.php.net to get a copy of this message
/*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"); ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43828 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43828&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43828&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#72613) next »