Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

date to age help (tag or global?)

Quote Reply
date to age help (tag or global?)
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.

<%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.
Subject Author Views Date
Thread date to age help (tag or global?) Alba 3124 Apr 4, 2005, 9:22 AM
Thread Re: [Alba] date to age help (tag or global?)
Andy 3043 Apr 4, 2005, 10:47 AM
Thread Re: [Andy] date to age help (tag or global?)
Alba 3081 Apr 4, 2005, 11:42 AM
Thread Re: [Alba] date to age help (tag or global?)
pugdog 3041 Apr 4, 2005, 1:12 PM
Thread Re: [pugdog] date to age help (tag or global?)
Alba 3030 Apr 4, 2005, 1:19 PM
Thread Re: [Alba] date to age help (tag or global?)
pugdog 3030 Apr 4, 2005, 1:32 PM
Post Re: [pugdog] date to age help (tag or global?)
Alba 2979 Apr 5, 2005, 6:32 AM