Hi, i was wondering if any of you has idea about how to include age in the profile as a dynamic value, i mean that is calculated automatically by aMember based on the birthdate entered by the member so it gets updated every year as well. Im researching myself and trying to find a solution for this. thank you.
Code: date_default_timezone_set('America/Los_Angeles'); function calculateAge($birthday){ return floor((time() - strtotime($birthday))/31556926); } //USAGE EXAMPLES echo calculateAge('1978-07-11'); echo calculateAge('7/11/1978'); echo calculateAge('7/11/78'); echo calculateAge('July 11, 1978');
Hi, thank you. Where should i put the function? i want the age displayed in the ACP in the members edit page. Also. i guess its okay to change the dates for variables, since this values will change according to the user that is displayed. Thanks.
Yes, i have a 3-dropdown-box set where the user enter their date of birth. I created custom field for Year, month and day each. Now i would like to have an additional field for the age, but not entered by the member but calculated automatically by aMember and updated every year on their birthday. I asked aMember staff about this possibility but they say it requires customization and right now they have a long task list so im trying to figure it out myself. thanks.