Template:Age: Difference between revisions
(New page: <includeonly>{{#expr:({{{4|{{CURRENTYEAR}}}}})-({{{1}}})-(({{{5|{{CURRENTMONTH}}}}})<({{{2}}})or({{{5|{{CURRENTMONTH}}}}})=({{{2}}})and({{{6|{{CURRENTDAY}}}}})<({{{3}}}))}}</includeonly>) |
(doc) |
||
Line 1: | Line 1: | ||
<includeonly>{{#expr:({{{4|{{CURRENTYEAR}}}}})-({{{1}}})-(({{{5|{{CURRENTMONTH}}}}})<({{{2}}})or({{{5|{{CURRENTMONTH}}}}})=({{{2}}})and({{{6|{{CURRENTDAY}}}}})<({{{3}}}))}}</includeonly> | <includeonly>{{#expr:({{{4|{{CURRENTYEAR}}}}})-({{{1}}})-(({{{5|{{CURRENTMONTH}}}}})<({{{2}}})or({{{5|{{CURRENTMONTH}}}}})=({{{2}}})and({{{6|{{CURRENTDAY}}}}})<({{{3}}}))}}</includeonly> | ||
<noinclude> | |||
This template returns the number of full years between two dates, or between a specified date and today (UTC). | |||
Syntax: | |||
*<nowiki>{{age|year1|month1|day1}}</nowiki> - for age up to now | |||
*<nowiki>{{age|year1|month1|day1|year2|month2|day2}}</nowiki> - for date up to date2 | |||
Examples: | |||
*<nowiki>{{age|1989|7|23|2003|7|14}}</nowiki> - gives 13 | |||
*<nowiki>{{age|1989|7|23}}</nowiki> - gives 17 | |||
If you use this template for calculating someone's age at death or age at a certain date (rather than their current age), please substitute it into the page, for example: {{#expr:(2003)-(1989)-((7)<(7)or(7)=(7)and(14)<(23))}}. | |||
</noinclude> |
Revision as of 00:15, 5 June 2007
This template returns the number of full years between two dates, or between a specified date and today (UTC).
Syntax:
- {{age|year1|month1|day1}} - for age up to now
- {{age|year1|month1|day1|year2|month2|day2}} - for date up to date2
Examples:
- {{age|1989|7|23|2003|7|14}} - gives 13
- {{age|1989|7|23}} - gives 17
If you use this template for calculating someone's age at death or age at a certain date (rather than their current age), please substitute it into the page, for example: 13.