Answers for "php date get age"

PHP
5

php get age from dob

Simple method for calculating Age from dob: $_age = floor((time() - strtotime('1986-09-16')) / 31556926); 31556926 is the number of seconds in a year.
Posted by: Guest on March-10-2020
0

age php datetime

function get_age( $date ) { 
    $age = date('Y') - $date; 
   if (date('md') < date('md', strtotime($date))) { 
       return $age - 1; 
   } 
   return $age; 
}
Posted by: Guest on June-10-2020

Browse Popular Code Answers by Language