Difference between revisions of "Template:Date difference"
Jump to navigation
Jump to search
(Undid revision 929632040 by 47.156.74.231 (talk) sorry wrong wiki window) |
|||
Line 63: | Line 63: | ||
}}{{#ifexpr: {{{year1|{{{1|{{CURRENTYEAR}}}}}}}} < 1 | | }}{{#ifexpr: {{{year1|{{{1|{{CURRENTYEAR}}}}}}}} < 1 | | ||
_ERROR - Can not handle dates before January 1, 1 A.D. | _ERROR - Can not handle dates before January 1, 1 A.D. | ||
− | }} }} }}</includeonly><noinclude></noinclude> | + | }} }} }}</includeonly><noinclude>{{documentation}}</noinclude> |
Latest revision as of 03:33, 7 December 2019
Usage
{{|month1= |day1= |year1= |month2= |day2= | year2=}}
This template returns the number of days between two dates. With unnamed parameters:
{{date difference|year1|month1|day1|year2|month2|day2}}
With unnamed parameters, calculating the days between today and the given date:
{{date difference|year1|month1|day1}}
Examples
- {{date difference|2007|5|24|2008|4|23}} gives 335
- {{date difference|2007|5|24}} gives 6,680
- {{date difference|2009|9|7}} gives 5,843
- {{date difference|2009|10|29}} gives 5,791
Similarity to other templates
- {{Age in days|2007|5|24|2008|4|23}} gives 335
- {{Age in days|2007|5|24}} gives 6680
- {{Age in days|2009|9|7}} gives 5843
- {{Age in days|2009|10|29}} gives 5791
See also
- Template:Seniority Calculates time in days from date given to the present day.
The above documentation is transcluded from Template:Date difference/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |