note 15120 added to function.date
| From: | wonschik at web dot de | Date: | Tue, 28 Aug 2001 22:26:13 +0000 |
| Subject: | note 15120 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17264@lists.php.net to get a copy of this message | ||
Sometimes you have to calculate the years between two dates.
i.e. how many years ago ...
i.e. how old is my friend ...
list($Y,$M,$D)=split("-",date("Y-m-d", strtotime("now")));
list($y,$m,$d)=split("-",date("Y-m-d", strtotime("10/03/1990")));
$age=(($M<$m)||(($M==$m)&&($D<$d)))?($Y-$y-1):($Y-$y);
:-) Sandor
http://www.php.net/manual/en/function.date.php