Online Chat
 Call Us: 
1-877-744-1221
Browse Submit a Ticket
 
Advanced Search
Tools
Rss Categories

Expression for person age calculation

Author: Edward Hardin Reference Number: AA-00293 Views: 8501 Last Updated: 07/21/2017 10:42 AM 0 Rating/ Voters

Expression for calculation of person age:

{# %TIMESTAMP|date_format:"Y" - birthyear - 1 + ifcond( %TIMESTAMP|date_format:"m" - birthmonth > 0, "1", "0") + ifcond( %TIMESTAMP|date_format:"m" - birthmonth != 0, "0", ifcond( %TIMESTAMP|date_format:"d" - birthday >= 0, "1", "0") ) #}

It requires that you have separate fields for birth year, birth month, and birth day on one of the previous form pages:

birthyear
birthmonth
birthday

This expression outputs a number of full person's years.