Template:Age

From Len'en Wiki
Jump to navigation Jump to search
Documentation icon Template documentation[view] [edit] [history] [purge]

{{Age}} returns the number of full years between two specified dates. If the second set of parameters is not included, it returns the number of full years between a specified date and today's date.

Usage

Dates are checked for validity. For example, 29 February 2000 is accepted, but 29 February 1900 is not a valid date.

Syntax
{{age|year|month|day|year2|month2|day2}} or
{{age|year|month|day}} or
{{age|date|date2}} or
{{age|date}}

Partial dates such as July 1989 (no day) or 1989 (no month and no day) can be entered using 0 for missing values. Having no year, or having a day with no month is an error.

Examples
{{age|1989|7|23|2003|7|14}} → 13
{{age|1989|7|0|2003|7|14}} → 14
{{age|1989|0|0|2003|7|14}} → 14
{{age|1989|7|23}} → 35
Note

This template does not check for incorrect input:

{{age|1980|7|14|1993|6|233}} returns "12" (surplus days do not count as extra months)
{{age|1980|7|14|1993|88|14}} returns "13" (surplus months do not count as extra years)