computing age from mySQL date
Posted: Wed Dec 08, 2010 11:44 am
I have a date retrieved from mySQL and am trying to compute a persons age.
$p1DOBphp = strtotime($p1DOB);
$p1Age = date() - $p1DOBphp;
$p1AgeYr = DATE('Y',$p1Age);
where $p1DOB is the Date Of Birth in a SQL date format (i.e. yyyy-mm-dd)
But I get weird results. What am I doing wrong.
Thanks/Hal
$p1DOBphp = strtotime($p1DOB);
$p1Age = date() - $p1DOBphp;
$p1AgeYr = DATE('Y',$p1Age);
where $p1DOB is the Date Of Birth in a SQL date format (i.e. yyyy-mm-dd)
But I get weird results. What am I doing wrong.
Thanks/Hal