Template:yearssince
From Homestar Runner Wiki
(Difference between revisions)
It's dot com (Talk | contribs) (expand examples) |
It's dot com (Talk | contribs) (this won't work for dates prior to 1970; implementing a workaround) |
||
Line 1: | Line 1: | ||
- | <includeonly>{{#ifexpr:{{CURRENTMONTH}}>{{#time:n|{{{1}}}}} or ( {{CURRENTMONTH}}={{#time:n|{{{1}}}}} and {{CURRENTDAY}}>={{#time:j|{{{1}}}}} )|{{#expr: {{CURRENTYEAR}} - {{#time:Y|{{{1}}}}} }}|{{#expr: ( {{CURRENTYEAR}} - 1 ) - {{#time:Y|{{{1}}}}} }} }}</includeonly><noinclude>Outputs the number of whole years since a specified date. | + | <includeonly>{{#ifexpr:{{CURRENTMONTH}}>{{{m|{{#time:n|{{{1}}}}}}}} or ( {{CURRENTMONTH}}={{{m|{{#time:n|{{{1}}}}}}}} and {{CURRENTDAY}}>={{{d|{{#time:j|{{{1}}}}}}}} )|{{#expr: {{CURRENTYEAR}} - {{{y|{{#time:Y|{{{1}}}}}}}} }}|{{#expr: ( {{CURRENTYEAR}} - 1 ) - {{{y|{{#time:Y|{{{1}}}}}}}} }} }}</includeonly><noinclude>Outputs the number of whole years since a specified date. |
*'''Usage:''' <code><nowiki>{{yearssince| some date }}</nowiki></code> | *'''Usage:''' <code><nowiki>{{yearssince| some date }}</nowiki></code> |
Revision as of 22:36, 19 May 2009
Outputs the number of whole years since a specified date.
- Usage:
{{yearssince| some date }}
- Examples:
{{yearssince| 25 Aug 2003}}
: 21{{yearssince| January 1, 2000}}
: 25{{yearssince| 10/25/76}}
: 48{{yearssince| July 1983}}
: 42{{yearssince| 1995}}
: 30