public function calculateAgeOnDate($date) { $ageInfo = parseAgeInfo($this->dob, $date); return $ageInfo['age']; }
/** * Function to find age in months (with decimal) on the target date * * @param string $dob date of birth * @param string $target date to calculate age on * @return float months(decimal) from dob to target(date) */ function convertDobtoAgeMonthDecimal($dob, $target) { $ageInfo = parseAgeInfo($dob, $target); return $ageInfo['age_in_months']; }