Calculation Formulas
Back to Calculation Formulas Overview
Back to Functions Overview
Function "Age"
Age(birthdaydate, referencedate, formatpattern [, localename | langcode, countrycode])
Function: Calculates the age of a person, based on the given birthday date and reference date. The result is the age in years of someone who was born at the day specified by birthdaydate, at the day specified by referencedate.
Return-Type: Number
Arguments:
birthdaydate - Type Text: The date of the birthday of the person.
referencedate - Type Text: The date of the reference day for which the age shall be calculated.
formatpattern - Type Text: specifies the format pattern to use to parse both the
"birthdaydate" and the "referencedate". Please see here for details
about this format pattern. Both dates must be specified with day, month and year components, using the same format as
specified by this parameter. The dates must not contain any time components.
(The following arguments are optional. Either you supply no further argument at all or you supply only
the following argument)
localename - Type Text: A name of a predefined locale. See here for
a list of available locale names. If specified, any locale specific text in "birthdaydate" or "referencedate" will
be expected according to this locale.
(Or you supply both the following two Arguments)
langcode - Type Text: A lowercase two-letter ISO-639 language code specifying the language
for the locale. For example, see here
http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt
for one list of the ISO-639 language codes.
countrycode - Type "Text": An uppercase two-letter ISO-3166 country code specifying the
country for the locale. For example, see here
http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm
for one list of the ISO-3316 country codes.
If "langcode" and "countrycode" are specified, they are used to create a locale for
the given language and country, and any locale specific text in "birthdaydate" or "referencedate" will be expected
according to this locale.
Examples:
Age("3/1/1970", "2/22/2004", "MM/dd/yyyy")
(results in an age of "33")
Age("March 1 1970", "February 22 2004", "MMMM dd yyyy")
(results in an age of "33")
Age("March 1 1970", "July 6 2004", "MMMM dd yyyy")
(results in an age of "34")