date() problem
| From: | Ryan A | Date: | Wed, 06 Jul 2005 19:07:51 +0000 |
| Subject: | date() problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-218222@lists.php.net to get a copy of this message | ||
Hi,
I'm confused, this should give me the age as 17 instead of 16...but it does
not...any ideas why?
<?php print date("Y:m:d");
$age="1988-07-06";
$day1=strtotime($age);
$day2 = strtotime(date("Y-m-d"));
$dif_s = ($day2-$day1);
$dif_d = ($dif_s/60/60/24);
$age = floor(($dif_d/365.24));
echo $age;
?>
Thanks,
Ryan