Template:dayssince

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
m
(won't work with dates prior to 1970)
Line 1: Line 1:
-
<includeonly>{{#expr:floor(({{#time:U}}-{{{{{#time:U|d m y}}|{{#time:U|{{{1}}}}}}}})/86400)}}</includeonly><noinclude>Outputs the number of days since a specified date. If the date is on or after 1 January 1970, it can be entered directly in a variety of formats. Otherwise, it must be specified using several parameters.
+
<includeonly>{{#expr:
 +
 
 +
floor( ( {{#time:U}} - {{#time:U|{{{1|}}} }} ) / 86400 )
 +
 
 +
}}</includeonly><noinclude>Outputs the number of days since a specified date (after 1 January 1970). If only a month or year is specified, the function evaluates from the first of the month or year, respectively.
===='''Usage'''====
===='''Usage'''====
Line 8: Line 12:
{| border=1 cellspacing=0 cellpadding=5 style="border-collapse:collapse"
{| border=1 cellspacing=0 cellpadding=5 style="border-collapse:collapse"
|-
|-
-
| <code><nowiki>{{dayssince| 15 Nov 2004 }}</nowiki></code> || {{dayssince| 15 Nov 2004 }}
+
| <code><nowiki>{{dayssince| 15 Nov 2008 }}</nowiki></code> || {{dayssince| 15 Nov 2008 }}
-
|-
+
-
| <code><nowiki>{{dayssince| January 1, 2000 }}</nowiki></code> || {{dayssince| January 1, 2000 }}
+
-
|-
+
-
| <code><nowiki>{{dayssince| 10/25/76 }}</nowiki></code> || {{dayssince| 10/25/76 }}
+
|-
|-
-
| <code><nowiki>{{dayssince| July 1983 }}</nowiki></code> || {{dayssince| July 1983 }}
+
| <code><nowiki>{{dayssince| January 1, 2009 }}</nowiki></code> || {{dayssince| January 1, 2009 }}
|-
|-
-
| <code><nowiki>{{dayssince| 1995 }}</nowiki></code> || {{dayssince| 1995 }}
+
| <code><nowiki>{{dayssince| 5/29/95 }}</nowiki></code> || {{dayssince| 5/29/95 }}
|-
|-
-
| <code><nowiki>{{dayssince| d=29 | m=5 | y=1952 }}</nowiki></code> || {{dayssince| d=29 | m=5 | y=1952 }}
+
| <code><nowiki>{{dayssince| March 2009 }}</nowiki></code> || {{dayssince| March 2009 }}
|-
|-
-
| <code><nowiki>{{dayssince| y=1215 }}</nowiki></code> || {{dayssince| y=1215 }}
+
| <code><nowiki>{{dayssince| 1985 }}</nowiki></code> || {{dayssince| 1985 }}
|}
|}
</noinclude>
</noinclude>

Revision as of 01:46, 20 May 2009

Outputs the number of days since a specified date (after 1 January 1970). If only a month or year is specified, the function evaluates from the first of the month or year, respectively.

Usage

  • {{dayssince| some date }}
  • {{dayssince| d=day | m=month | y=year }}

Examples

{{dayssince| 15 Nov 2008 }} 6316
{{dayssince| January 1, 2009 }} 6269
{{dayssince| 5/29/95 }} 11235
{{dayssince| March 2009 }} 6210
{{dayssince| 1985 }} 14975


Personal tools