$birthday = '1985-02-01';
$age = date('Y', time()) - date('Y', strtotime($birthday)) - 1;
if (date('m', time()) == date('m', strtotime($birthday))){
if (date('d', time()) > ; date('d', strtotime($birthday))){
$age++;
}
}elseif (date('m', time()) > date('m', strtotime($birthday) ))){
$age++;
}
echo $age;
?>
mysql現在時刻-年計算
select date_add(curdate ()、間隔 -1 年);