Template:Age: Difference between revisions
New template: age calculation |
Treat blank birth day as 1 (avoid expression error) |
||
| Line 1: | Line 1: | ||
<includeonly>{{#if:{{{2|}}}|{{#expr:({{{4|{{#time:Y}}}}})-({{{1}}})-((({{{5|{{#time:n}}}}})<({{{2}}})) or ((({{{5|{{#time:n}}}}})=({{{2}}})) and (({{{6|{{#time:j}}}}})<({{{3|1 | <includeonly>{{#if:{{{2|}}}|{{#expr:({{{4|{{#time:Y}}}}})-({{{1}}})-((({{{5|{{#time:n}}}}})<({{{2}}})) or ((({{{5|{{#time:n}}}}})=({{{2}}})) and (({{{6|{{#time:j}}}}})<({{#if:{{{3|}}}|{{{3}}}|1}}))))}}|{{#expr:({{{4|{{#time:Y}}}}})-({{{1}}})-1}}–{{#expr:({{{4|{{#time:Y}}}}})-({{{1}}})}}}}</includeonly><noinclude> | ||
Calculates age in full years. | Calculates age in full years. | ||