Template:DATEDIFF/doc
< Template:DATEDIFF
Jump to navigation
Jump to search
Revision as of 07:06, 14 August 2010 by imported>Droll (replace {{Template doc page}} with {{Documentation subpage}} using AWB)
| This is a documentation subpage for Template:DATEDIFF. It contains usage information, categories and other content that is not part of the original template page. |
This template returns the difference in days (possibly with decimals) between two dates in the Gregorian calendar.
The return value is positive if date2 comes after date1, it is negative if date2 comes before date1 (i.e. the template computes date2-date1).
Syntax
- {{DATEDIFF|year1|month1|day1|year2|month2|day2}}
- {{DATEDIFF|year1|month1|day1|year2|month2|day2|hour1|hour2}}
- {{DATEDIFF|year1|month1|day1|year2|month2|day2|hour1|hour2|minute1|minute2}}
- {{DATEDIFF|year1|month1|day1|year2|month2|day2|hour1|hour2|minute1|minute2|second1|second2}}
- The dates can optionally be given more precision with time (their default time is noon, i.e. 12:00:00 UTC), for computing timezones.
Examples
| Code | Output |
|---|---|
{{DATEDIFF|2004|6|1|2008|6|1}}
|
1461 |
{{DATEDIFF|2008|6|1|2004|6|1}}
|
−1461 |
See also
- Template:DATECOMP (backlinks edit)
- Template:DATEDIFF2 (backlinks edit) - same as this template, but requires only two parameters, and can only be used for dates from 1 January 1970.
- Template:JULIANDAY (backlinks edit) - used internally by this template.