Changes
→Examples
{{Documentation subpage}}
<!-- Categories and interwikis go at the bottom of this page. -->
== Usage ==
This template calculates a person's current age based on a known age as of specified date. This is useful when a reference states a person's age at the time of the reference's publication.
{{tlx|Age as of date|age|year|month|day}}
The age, year, and day must be supplied as [[natural number]]s; month can be specified as a natural number as well as by name or abbreviation (e.g., "August" or "Aug"). The [[Gregorian calendar]] is assumed, with no special support provided for [[dual dating]] or the difference between [[Old Style and New Style dates]] .
If a reference dated July 4, {{#expr: {{CURRENTYEAR}} - 2}}, mentions that someone is 50 years old, that person's current age can be rendered using:
{{tlx|Age as of date|50|{{#expr: {{CURRENTYEAR}} - 2}}|July|4}}
== Examples ==
{| class="wikitable"
! Template text
! Result 18
|-
| style="text-align:left;" | <kbd><nowiki>{{Age as of date|18|</nowiki>{{#expr: {{CURRENTYEAR}} - 2}}|1|1}}</kbd>
| style="text-align:center;" | {{Age as of date|50|{{#expr: {{CURRENTYEAR}} - 2}}|1|1}}
|-
| style="text-align:left;" | <kbd><nowiki>{{Age as of date|50|</nowiki>{{#expr: {{CURRENTYEAR}} - 2}}|12|31}}</kbd>
| style="text-align:center;" | {{Age as of date|50|{{#expr: {{CURRENTYEAR}} - 2}}|12|31}}
|-
| style="text-align:left;" | <kbd><nowiki>{{Age as of date|50|</nowiki>{{#expr: {{CURRENTYEAR}} - 2}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}}</kbd>
| style="text-align:center;" | {{Age as of date|50|{{#expr: {{CURRENTYEAR}} - 2}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}}
|-
| style="text-align:left;" | <kbd><nowiki>{{Age as of date|50|</nowiki>{{#expr: {{CURRENTYEAR}} - 2}}|{{CURRENTMONTHABBREV}}|{{CURRENTDAY}}}}</kbd>
| style="text-align:center;" | {{Age as of date|50|{{#expr: {{CURRENTYEAR}} - 2}}|{{CURRENTMONTHABBREV}}|{{CURRENTDAY}}}}
|-
| style="text-align:left;" | <kbd><nowiki>{{Age as of date|50|</nowiki>{{#expr: {{CURRENTYEAR}} - 2}}|{{CURRENTMONTHNAME}}|{{CURRENTDAY}}}}</kbd>
| style="text-align:center;" | {{Age as of date|50|{{#expr: {{CURRENTYEAR}} - 2}}|{{CURRENTMONTHNAME}}|{{CURRENTDAY}}}}
|}
== See also ==
* [[Wikipedia:Age calculation templates]]
{{Birth, death and age templates}}
<includeonly>
<!-- Categories and interwikis go here: -->
[[Category:Date mathematics templates]]
[[bn:টেমপ্লেট:Age as of date]]
[[ur:سانچہ:آج تک عمر]]
</includeonly>
<!-- Categories and interwikis go at the bottom of this page. -->
== Usage ==
This template calculates a person's current age based on a known age as of specified date. This is useful when a reference states a person's age at the time of the reference's publication.
{{tlx|Age as of date|age|year|month|day}}
The age, year, and day must be supplied as [[natural number]]s; month can be specified as a natural number as well as by name or abbreviation (e.g., "August" or "Aug"). The [[Gregorian calendar]] is assumed, with no special support provided for [[dual dating]] or the difference between [[Old Style and New Style dates]] .
If a reference dated July 4, {{#expr: {{CURRENTYEAR}} - 2}}, mentions that someone is 50 years old, that person's current age can be rendered using:
{{tlx|Age as of date|50|{{#expr: {{CURRENTYEAR}} - 2}}|July|4}}
== Examples ==
{| class="wikitable"
! Template text
! Result 18
|-
| style="text-align:left;" | <kbd><nowiki>{{Age as of date|18|</nowiki>{{#expr: {{CURRENTYEAR}} - 2}}|1|1}}</kbd>
| style="text-align:center;" | {{Age as of date|50|{{#expr: {{CURRENTYEAR}} - 2}}|1|1}}
|-
| style="text-align:left;" | <kbd><nowiki>{{Age as of date|50|</nowiki>{{#expr: {{CURRENTYEAR}} - 2}}|12|31}}</kbd>
| style="text-align:center;" | {{Age as of date|50|{{#expr: {{CURRENTYEAR}} - 2}}|12|31}}
|-
| style="text-align:left;" | <kbd><nowiki>{{Age as of date|50|</nowiki>{{#expr: {{CURRENTYEAR}} - 2}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}}</kbd>
| style="text-align:center;" | {{Age as of date|50|{{#expr: {{CURRENTYEAR}} - 2}}|{{CURRENTMONTH}}|{{CURRENTDAY}}}}
|-
| style="text-align:left;" | <kbd><nowiki>{{Age as of date|50|</nowiki>{{#expr: {{CURRENTYEAR}} - 2}}|{{CURRENTMONTHABBREV}}|{{CURRENTDAY}}}}</kbd>
| style="text-align:center;" | {{Age as of date|50|{{#expr: {{CURRENTYEAR}} - 2}}|{{CURRENTMONTHABBREV}}|{{CURRENTDAY}}}}
|-
| style="text-align:left;" | <kbd><nowiki>{{Age as of date|50|</nowiki>{{#expr: {{CURRENTYEAR}} - 2}}|{{CURRENTMONTHNAME}}|{{CURRENTDAY}}}}</kbd>
| style="text-align:center;" | {{Age as of date|50|{{#expr: {{CURRENTYEAR}} - 2}}|{{CURRENTMONTHNAME}}|{{CURRENTDAY}}}}
|}
== See also ==
* [[Wikipedia:Age calculation templates]]
{{Birth, death and age templates}}
<includeonly>
<!-- Categories and interwikis go here: -->
[[Category:Date mathematics templates]]
[[bn:টেমপ্লেট:Age as of date]]
[[ur:سانچہ:آج تک عمر]]
</includeonly>