Template:dayssince
From Homestar Runner Wiki
(Difference between revisions)
m |
(use new cat) |
||
| (includes 4 intermediate revisions) | |||
| Line 1: | Line 1: | ||
| - | <includeonly>{{#expr:floor(({{#time:U}}- | + | <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'''==== | ||
*<code><nowiki>{{dayssince| some date }}</nowiki></code> | *<code><nowiki>{{dayssince| some date }}</nowiki></code> | ||
| - | |||
===='''Examples'''==== | ===='''Examples'''==== | ||
{| 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 | + | | <code><nowiki>{{dayssince| 15 Nov 2008 }}</nowiki></code> || {{dayssince| 15 Nov 2008 }} |
|- | |- | ||
| - | | <code><nowiki>{{dayssince| January 1, | + | | <code><nowiki>{{dayssince| January 1, 2009 }}</nowiki></code> || {{dayssince| January 1, 2009 }} |
|- | |- | ||
| - | | <code><nowiki>{{dayssince| | + | | <code><nowiki>{{dayssince| 5/29/95 }}</nowiki></code> || {{dayssince| 5/29/95 }} |
|- | |- | ||
| - | | <code><nowiki>{{dayssince| | + | | <code><nowiki>{{dayssince| March 2009 }}</nowiki></code> || {{dayssince| March 2009 }} |
|- | |- | ||
| - | | <code><nowiki>{{dayssince| | + | | <code><nowiki>{{dayssince| 1985 }}</nowiki></code> || {{dayssince| 1985 }} |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
|} | |} | ||
| + | |||
| + | [[Category:Date and Time Formatting Templates|{{PAGENAME}}]] | ||
</noinclude> | </noinclude> | ||
Current revision as of 17:34, 25 November 2017
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.
[edit] Usage
{{dayssince| some date }}
[edit] Examples
{{dayssince| 15 Nov 2008 }} | 6319 |
{{dayssince| January 1, 2009 }} | 6272 |
{{dayssince| 5/29/95 }} | 11238 |
{{dayssince| March 2009 }} | 6213 |
{{dayssince| 1985 }} | 14975 |
