Template:Birth date and age: Difference between revisions
Template page
More actions
Created page with "<includeonly><!-- Template:Birth date and age --> {{#switch: {{#if:{{{3|}}}|3|{{#if:{{{2|}}}|2|{{#if:{{{1|}}}|1|0}}}}}} | 3 = {{MONTHNAME|{{{2}}}}} {{{3}}}, {{{1}}}<span class="noprint"> (age {{#expr:{{#time:Y}} - {{{1}}} - ( ({{#time:n}} < {{{2}}}) or ({{#time:n}} = {{{2}}} and {{#time:j}} < {{{3}}}) ) }})</span> | 2 = {{MONTHNAME|{{{2}}}}}, {{{1}}} | 1 = {{{1}}} | 0 = }}</includeonly><noinclude> {{clear}} == Usage == This template formats a birth date and calcula..." |
|||
| Line 13: | Line 13: | ||
{{Birth date and age|YYYY|MM|DD}} | {{Birth date and age|YYYY|MM|DD}} | ||
</pre> | </pre> | ||
* '''Example:''' | * '''Example:''' <code><nowiki>{{Birth date and age|1955|10|28}}</nowiki></code> will display "October 28, 1955 (age 69)". | ||
[[Category:Date templates]] | [[Category:Date templates]] | ||
</noinclude> | </noinclude> | ||
Revision as of 21:33, 12 July 2025
Usage
This template formats a birth date and calculates the person's current age.
{{Birth date and age|YYYY|MM|DD}}
- Example:
{{Birth date and age|1955|10|28}}will display "October 28, 1955 (age 69)".