Difference between revisions of "Template:Birth date and age"
(Created page with "<includeonly>{{#if:{{{3|}}} | {{{1}}} {{#switch:{{{2}}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December}} {{...") |
|||
| Line 1: | Line 1: | ||
| − | <includeonly>{{# | + | <includeonly>{{#time:j F Y|{{{3}}}-{{{2}}}-{{{1}}}}} (aged {{#expr:{{CURRENTYEAR}}-{{{3}}}-{{#ifexpr:{{CURRENTMONTH}}>{{{2}}}|0|{{#ifexpr:{{CURRENTMONTH}}={{#expr:{{{2}}}}}|{{#ifexpr:{{CURRENTDAY}}>={{#expr:{{{1}}}}}|0|1}}|1}}}}}})</includeonly><noinclude> |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | }} | ||
{{Documentation}} | {{Documentation}} | ||
[[Category:Date mathematics templates]] | [[Category:Date mathematics templates]] | ||
</noinclude> | </noinclude> | ||
Revision as of 04:39, 19 May 2026
Template documentation
This template displays a birth date and automatically calculates the person's current age.
Contents
Usage
{{Birth date and age|day|month|year}}
- `day` – day of month (1–31)
- `month` – month number (1–12)
- `year` – four-digit year
Examples
| Code | Output |
|---|---|
{{Birth date and age|2008|4|14}} |
April 2008, 14 (aged 2012) |
{{Birth date and age|2000|1|1}} |
January 2000, 1 (aged 2025) |
Formatting options
- Add
|df=yesfor day-first format (already default in many wikis) - Add
|mf=yesfor month-first format (April 14, 2008)
See also
| {{Death date and age}}
}}
| {{Birth date}}
}}
-
{{Age
| {{Age}}
}}