Difference between revisions of "Template:Age"

From Hattrick
m (correct rounder age in case days are more than 66)
m
Line 1: Line 1:
<includeonly>{{#expr:floor{{#expr:{{JULIANDIFF|{{#time:Y}}|{{#time:m}}|{{#time:d}}|{{{1}}}|{{{2}}}|{{{3}}} }} / 112}}}} years {{#expr:{{JULIANDIFF|{{#time:Y}}|{{#time:m}}|{{#time:d}}|{{{1}}}|{{{2}}}|{{{3}}} }} mod 112}} days</includeonly><noinclude>{{documentation}}</noinclude>
+
<includeonly>{{#expr:floor{{#expr:{{JULIANDIFF|{{#time:Y}}|{{#time:m}}|{{#time:d}}|{{{1}}}|{{{2}}}|{{{3}}} }} / 112}}}} years and {{#expr:{{JULIANDIFF|{{#time:Y}}|{{#time:m}}|{{#time:d}}|{{{1}}}|{{{2}}}|{{{3}}} }} mod 112}} days</includeonly><noinclude>{{documentation}}</noinclude>

Revision as of 13:11, 4 November 2010

[edit] Template documentation

Explanation
Calculates the Hattrick time (years and days) that has passed from a date x until now. Typical use: automatical player age display, hence the name. For years only, use Template:AgeYears.
Syntax
{{Age | YEAR | MONTH | DAY }}
Examples
{{Age|2010|10|10}} produces 31 years and 82 days
{{Age|2009|10|10}} produces 34 years and 111 days
{{Age|2008|10|10}} produces 38 years and 28 days
{{Age|2002|10|10}} produces 57 years and 92 days