I want to calculate a person's age from their date of birth.
Their date of birth is in the field prof_birthday within GT community and I can call it into my LSQL templates.
I can also get the current date into the templates but when I attempt to calculate the difference, I only get the year of birth.
I want to find the number of days difference between the current date and date of birth, then divide by 365 to get the age. (it's for children so I'm not too bothered about leap years).
Can anybody help me with either:
I know there are discussions within the forum along similar lines and I've also looked in the help files but I cannot work out how to do this.
Thanks for your help.
Their date of birth is in the field prof_birthday within GT community and I can call it into my LSQL templates.
<%Plugins::Auth_Community::get_profile($LinkOwner)%>
<%prof_birthday%>
I can also get the current date into the templates but when I attempt to calculate the difference, I only get the year of birth.
I want to find the number of days difference between the current date and date of birth, then divide by 365 to get the age. (it's for children so I'm not too bothered about leap years).
Can anybody help me with either:
- the correct way to calculate the age within the template.
- a global to calculate the above.
I know there are discussions within the forum along similar lines and I've also looked in the help files but I cannot work out how to do this.
Thanks for your help.