Jump to content

Calculate Age


Recommended Posts

Hello Alejandro:

I'm trying to implement some PHP code you shared to calculate someone's age from their date of birth.  Below is the code;

$bday = new DateTime($text); $today = new DateTime(); $diff = $today->diff($bday); return $diff->y;

I have a field for the date of birth {jr_dateofbirth}.  Do I need to create a banner field like {jr_age} to display the results?

How do I format the code to make it work for the fields I am using?

I hope I made sense in what I'm trying to acheive.



Edited by completepro1-1602803676
Link to comment
  • Create New...