Template:Days since: Difference between revisions
Jump to navigation
Jump to search
Richardpruen (talk | contribs) m 1 revision imported |
imported>JPxG No edit summary |
||
| Line 1: | Line 1: | ||
<noinclude><!-- | <noinclude><!-- | ||
-======================================================================== | -======================================================================== | ||
- Days | - Days between the last-edited date of a page, and a date formatted as %Y %b $d (four-digit year, month name, and day). | ||
- Day can be zero-padded or not. Month MUST be supplied as "Feb" or "February". | |||
- This won't work for timestamps with numbers (like "1969 12 31"). | |||
-======================================================================== | -======================================================================== | ||
--></noinclude>{{ | --></noinclude><includeonly>{{#ifexist:{{{3|}}}<!-- | ||
# | |||
If three parameters are supplied, parse them as "YYYY", "MM", and "DD", and supply them as "DD Month YYYY". | |||
-->|{{Time ago|{{{3}}} {{MONTHNAME|{{{2}}}}} {{{1}}}|magnitude=days|ago=|numeric=y}}<!-- | |||
If one parameter is supplied, parse and supply it as "DD Month YYYY". | |||
-->|{{Time ago|{{{1}}}|magnitude=days|ago=|numeric=y}}<!-- | |||
-->}}</includeonly> | |||
<noinclude> | |||
{{Documentation}} | {{Documentation}} | ||
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here --> | <!-- Add categories to the /doc subpage, interwikis to Wikidata, not here --> | ||
</noinclude> | </noinclude> | ||
Latest revision as of 21:18, 28 June 2022
{{Days since}} shows the years/days (or months/days) since a specific date.
Usage
This template is a facade for {{Time ago}} which invokes that template to specifically return an integer of the amount of days since a given timestamp. {{Time ago}} is a larger template, with many more options, that can be used for more customized output.
There are two ways to use this template:
- With three parameters
YYYY-MM-DD: {{Days since|2025|06|13}} - With one parameter. If this is done, the date MUST be formatted in one of these four ways:
- 03 Dec 1969
- 03 December 1969
- 3 Dec 1969
- 3 December 1969
Using this template with a single parameter is identical to using {{Time ago|03 Dec 1969|magnitude=days|ago=|numeric=y}}.
{{Days since|1 Jan 2025}} produces: 314
{{Days since|2025|06|13}} produces: 0
{{Days since|31 December 1969}} produces: 20404
See also
- Template:Time ago – more expansive set of functions, of which this template is a subset.
- Template:Birth date and age – show birthdate and age in years
- Template:Years and days – show years and days for a count in days