age(
age(
BIRTHDATE
)

The age( function calculates a person’s current age (in years) from their birthdate.

Parameters

This function has one parameter:

birthdate – The person’s date of birth (see the date( function).

Description

This function calculates a person’s current age (in years) from their birthdate. It correctly accounts for leap years.

    age(date("jan 7, 1957")) ☞ 56
    age(date("June 4, 2011")) ☞ 4

Note: This function is equivalent to:

    yearvalue(today()) - yearvalue(birthdate) - ?(monthvalue(birthdate) > monthvalue(today()) or
        monthvalue(birthdate)=monthvalue(today()) and dayvalue(birthdate) > dayvalue(today()),1,0)

See Also

- completedatestr( -- converts a date to text, spelling out the month and including the day of the week.
- Date Arithmetic Formulas -- performing calculations on dates, and converting between dates and text.
- Dates -- working with dates.
- datestr( -- converts a date to text using format *mm/dd/yy*.
- daystr( -- converts a date to the day of the week (for example *Sunday*).
- eurodatestr( -- converts a date to text in European format.
- longdatestr( -- converts a date to text by spelling out the month.
- Smart Dates -- keyboard entry of dates.
- years( -- converts a number of days into a number of years.
- yearsbetween( -- calculates the number of years between two dates.

History

Version | Status | Notes
10.0 | No Change | Carried over from Panorama 6.0.