Template:Age in years and days

You don't need to be Editor-In-Chief to add or edit content to WikiDoc. You can begin to add to or edit text on this WikiDoc page by clicking on the edit button at the top of this page. Next enter or edit the information that you would like to appear here. Once you are done editing, scroll down and click the Save page button at the bottom of the page.

Jump to: navigation, search

The content of this template is only visible when the template is transcluded.

This high-risk template has been protected from editing to prevent vandalism. (protection log).
Please discuss changes on the talk page or request unprotection. You may use {{editprotected}} on the talk page to ask for an administrator to make an edit for you.

[view] [edit] Template documentation

This template returns the number of full years and remaining days between two specified dates. If the second set of parameters is not included, it will return the number of full years and remaining days between a specified date and today's date.

Syntax:
{{age in years and days|year1|month1|day1|year2|month2|day2}} or
{{age in years and days|year1|month1|day1}}
Examples:
{{age in years and days|1989|7|23|2003|7|14}} returns "13 years, Expression error: Unrecognised punctuation character "[" Expression error: Unrecognised word "expression""
{{age in years and days|1989|7|23}} returns "19 years, Expression error: Unrecognised punctuation character "[" Expression error: Unrecognised word "expression""
When using this template to calculate a person's age at death or a person's age on a specified date (rather than the person's current age), please substitute it into the page.
Example: {{subst:age in years and days|1989|7|23|2003|7|14}}
Note:
This template does not check for incorrect input:
{{age in years and days|1980|7|14|1993|6|233}} returns "12 years, Expression error: Unrecognised punctuation character "[" Expression error: Unrecognised word "expression"" (surplus days do not count as extra months)
{{age in years and days|1980|7|14|1993|88|14}} returns "13 years, Expression error: Unrecognised punctuation character "[" Expression error: Unrecognised word "expression"" (surplus months do not count as extra years)

Note also that due to leap years the measure "years and days" fails to be fully additive:

{{age in years and days|2007|2|27|2008|3|2}} returns "1 year, Expression error: Unrecognised punctuation character "[" Expression error: Unrecognised word "expression""

but split up:

{{age in years and days|2007|2|27|2007|3|2}} returns "0 years, Expression error: Unrecognised punctuation character "[" Expression error: Unrecognised word "expression""
{{age in years and days|2007|3|2|2008|3|2}} returns "1 year, Expression error: Unrecognised punctuation character "[" Expression error: Unrecognised word "expression""

See also

Personal tools