Difference between revisions of "Template:Age"

From Hattrick
(Created page with '<includeonly>{{#expr:{{JULIANDAY|2010|11|3}}-{{JULIANDAY|{{{1}}}|{{{2}}}|{{{3}}} }} }}</includeonly> <noinclude>aaa</noinclude>')
 
Line 1: Line 1:
<includeonly>{{#expr:{{JULIANDAY|2010|11|3}}-{{JULIANDAY|{{{1}}}|{{{2}}}|{{{3}}} }} }}</includeonly>
+
<includeonly>{{#expr:{{JULIANDIFF|{{#time:Y}}|{{#time:m}}|{{#time:d}}|{{{1}}}|{{{2}}}|{{{3}}} }} / 112 round 0}} years {{#expr:{{JULIANDIFF|{{#time:Y}}|{{#time:m}}|{{#time:d}}|{{{1}}}|{{{2}}}|{{{3}}} }} mod 112}} days</includeonly><noinclude>{{documentation}}</noinclude>
<noinclude>aaa</noinclude>
 

Revision as of 21:43, 3 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 28 years and 36 days
{{Age|2009|10|10}} produces 31 years and 65 days
{{Age|2008|10|10}} produces 34 years and 94 days
{{Age|2002|10|10}} produces 54 years and 46 days