Template:yearssince

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
(semantics; if the date hasn't passed, the use last year as the starting point)
(down to one parameter)
Line 1: Line 1:
-
<includeonly>{{#ifexpr:{{CURRENTMONTH}}>{{{m|0}}} or ( {{CURRENTMONTH}}={{{m|0}}} and {{CURRENTDAY}}>={{{d|0}}} )|{{#expr: {{CURRENTYEAR}} - {{{y}}} }}|{{#expr: ( {{CURRENTYEAR}} - 1 ) - {{{y}}} }} }}</includeonly><noinclude>
+
<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>
-
Usage: <nowiki><code>{{yearssince|m=month|d=day|y=year}}</code></nowiki>
+
Usage: <nowiki><code>{{yearssince| some date }}</code></nowiki>
-
Example: <nowiki><code>{{yearssince|m=1|d=13|y=2003}}</code></nowiki> will output the number of years since January 1st, 20003.
+
Example: <nowiki><code>{{yearssince| 25 Aug 2003}}</code></nowiki> will output the number of whole years since August 25, 20003.
</noinclude>
</noinclude>

Revision as of 22:07, 19 May 2009


Usage: <code>{{yearssince| some date }}</code> Example: <code>{{yearssince| 25 Aug 2003}}</code> will output the number of whole years since August 25, 20003.

Personal tools