I have seen examples that show the number of years between a date picker and the current date but I am using a date of birth and date of passing to calculate the age of the person when they passed away.
Any ideas how this can be achieved?
Could I modify the below?
$date = get_field('date_of_birth');
$birthday = new DateTime($date);
$interval = $birthday->diff(new DateTime);
<p>Age: <strong><?php echo $interval->y; ?></strong></p>
<?php } ?>