Template:Birth-date and age/doc
This is a documentation subpage for Template:Birth-date and age. It contains usage information, categories and other content that is not part of the original template page. |
{{Birth-date and age}} displays a person’s birth date and age. Besides calculating the age of the person, the benefit of using this template is to allow for the inclusion of hidden microformat dates, which may be indexed or searched by software tools.
Note: The template may not calculate the age correctly if a full date (month, day, year) is not provided. For example, a person who was born in 1941 could be either 82 or 83, depending on whether they have reached their birthday in the current year:
{{Birth-date and age|1941}}
→ September Expression error: Unrecognized punctuation character "{"., 1941 invalid month (age 83){{Birth-date and age|November 1941}}
→ Expression error: Unrecognized punctuation character "{"., Expression error: Unrecognized word "november".Expression error: Unrecognized word "november".Expression error: Unrecognized word "november". (age 83)
When only the year is known, consider using {{Birth year and age}} instead:
{{Birth year and age|1941}}
→ 1941 (age 82–83){{Birth year and age|1941|11}}
→ November 1941 (age 82–83)
Usage
- Format
{{Birth-date and age| birth date }}
{{Birth-date and age| birth date | wikitext to display in place of 'birth date'. Like the right hand parameter in a wikilink, this could be alternate text, links, templates etc. }}
Examples
Month first format: Sample below displays , with invisible microformat date: 1941-04-12
Expression error: Unrecognized punctuation character "{"., Expression error: Unrecognized word "april".Expression error: Unrecognized word "april".Expression error: Unrecognized word "april". (age 83)
|
Day first format: Sample below displays , with invisible microformat date: 1941-04-12
Expression error: Unrecognized punctuation character "{"., Expression error: Unrecognized word "april".Expression error: Unrecognized word "april".Expression error: Unrecognized word "april". (age 83)
|
Year only, year and month only: Sample below displays , with invisible microformat date: 1941
September Expression error: Unrecognized punctuation character "{"., 1941 invalid month (age 83)
|
Demo of ISO date, as well as alternate displays. Sample below displays , with invisible microformat date: 1941-04-12
Expression error: Unrecognized punctuation character "{"., 1925Expression error: Unrecognized word "twelfth". (age 83)
|
Parameters
{{birth-date and age|birth date|additional parameters}}
Parameter | Default | ||
---|---|---|---|
(required) | 1 | Birth date. May be year only, year and month, year month and day, expressed in natural formats: e.g.: 24 August 1953, 1955-08-25, Sunday, December 7, 1941. If parameter three is not specified, the birth date is displayed in exactly this format. This value as well as parameter 2 may not include links. If links or templates that do not evaluate as recognizable dates are desired, use parameter 2. | – |
(optional) | 2 | The birth date to display. This may include links or templates, or any combination of them, and overrides parameter 1. | parm 1 |
(optional) | bce | If birth date is BC, set to "b". | – |
(optional) | gregorian | If Julian date is used, this parameter is required. The date provided is used for emitting the correct microformat translation of the birth date. | parm 1 |
(optional) | dt | This value if present is the ISO8601 value emitted to indicate microformat birth date. It overrides any calculated value. | – |
There are a number of templates that you can use to set out a person's birth date or birth year, current age, death date or death year, and age at death. This is especially useful in infoboxes. Using these templates rather than simply inserting dates into articles allow hidden metadata about dates to be put into articles. Web browsers and other types of software can look up the metadata and use them for certain types of displays or searches.
The year, month and day of birth and death dates must be typed in numbers. If a number is smaller than ten, you do not have to type a zero before it (for example, you can type "7" instead of "07").
All the templates
What you should type | Example | What you will see |
---|---|---|
{{Birth date|[year of birth]|[month of birth]|[day of birth]}} | {{Birth date|1965|8|9}}
|
August 9, 1965 |
{{Birth date and age|[year of birth]|[month of birth]|[day of birth]}} | {{Birth date and age|1965|8|9}}
|
August 9, 1965 |
{{Birth year and age|[year of birth]|[optional month of birth, if known]}} | {{Birth year and age|1965}}
|
1965 (age 58–59) |
{{Birth year and age|1965|8}}
|
August 1965 (age 59) | |
{{Death date|[year of death]|[month of death]|[day of death]}} | {{Death date|2005|12|25}}
|
December 25, 2005 |
{{Death date and age|[year of death]|[month of death]|[day of death]|[year of birth]|[month of birth]|[day of birth]}} | {{Death date and age|2005|12|25|1965|8|9}}
|
December 25, 2005 | (aged 40)
{{Death year and age|[year of death]|[year of birth]|[optional month of death, if known]}} | {{Death year and age|2005|1965}}
|
2005 (aged 39–40) |
{{Death year and age|2005|1965|12}}
|
December 2005 (aged 39–40) |
Notes
{{Birth date and age}} and {{Birth year and age}}
In {{Birth date and age}} and {{Birth year and age}}, the person's age is calculated based on the current date.
{{Birth year and age}} and {{Death year and age}}
The templates {{Birth year and age}} and {{Death year and age}} show a person's year of birth or death and his or her approximate (rough) age. The templates are useful when only the year of a person's birth and/or death are known, or if you do not want to state a person's full dates of birth and death for privacy reasons.
The person's age is estimated in the following way:
- {{Birth year and age}} – let us assume:
- that the person in question was born some time in 1969; and
- that the present date is 22 November 2024.
- If the person was born before 22 November 1969 then he will be 54 years old on 22 November 2024 as he has not had his 55th birthday yet. On the other hand, if he was born exactly on or before 22 November 1969, then he will be 55 years old.
- Therefore, the template
{{Birth year and age|1969}}
- displays his birth year and age as: 1969 (age 54–55)
- Therefore, the template
- {{Death year and age}} – let us assume:
- that the person in question was born some time in 1973; and
- that she died some time in 2023.
- We can think of two extremes: (1) that the person was born on 31 December 1973 and died on 1 January 2023, in which case she would have been 49 years old at the time of her death as she did not achieve her 50th birthday on 31 December 2023; and (2) that she was born on 1 January 1973 and died on 31 December 2023, in which case she would have been 50 years old at the time of her death as she had her 50th birthday on 1 January 2023.
- Therefore, the template
{{Death year and age|2023|1973}}
- shows her death year and age as: 2023 (aged 49–50)
- Therefore, the template
Templates allowing day to be shown before month
The templates in the table below take an optional parameter "df" (which stands for "date first") – you can choose whether to use it or not. If "df=yes", then the day of the date is shown before the month. This is for articles about people from parts of the world where the day usually comes before the month in a date.
What you should type | Example | What you will see |
---|---|---|
{{Birth date|[year of birth]|[month of birth]|[day of birth]|df=yes}} | {{Birth date|1965|8|9|df=yes}}
|
9 August 1965 |
{{Birth date and age|[year of birth]|[month of birth]|[day of birth]|df=yes}} | {{Birth date and age|1965|8|9|df=yes}}
|
9 August 1965 |
{{Death date|[year of death]|[month of death]|[day of death]|df=yes}} | {{Death date|2005|12|25|df=yes}}
|
25 December 2005 |
{{Death date and age|[year of death]|[month of death]|[day of death]|[year of birth]|[month of birth]|[day of birth]|df=yes}} | {{Death date and age|2005|12|25|1965|8|9|df=yes}}
|
25 December 2005 | (aged 40)