Display Year and Month from custom field + Age Calculator

You create two date objects and compare with the diff() methode.

$from = new DateTime( '1970-01-01' );
$to = new DateTime('today');
$years = $from->diff($to)->y;
$months =  $from->diff($to)->m;

echo $years . ' years and ' . $months . ' months.';

=> 46 years and 1 months.