Support

Account

Home › Forums › General Issues › Calculate Age from Date field › Reply To: Calculate Age from Date field

  • <?php 
        $date = get_field('date_of_birth');
        $birthday = new DateTime($date);
        $interval = $birthday->diff(new DateTime);
        echo $interval->y.' years old';
    ?>