This template is used on approximately 2,300 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before changing this template.
This template returns the number of days between two dates. Dates may be input either as full dates or as year, month and day. Omitted parameters to their current value.
By adding |sortable=on a sort key will be added to the output for use in sortable tables. The sort key is produced by ((nts)) and is based on the SI unit of time (the second).
gives unformatted numbers with hyphens as minus signs[1] (for use in further calculations).
|format=commas
gives numbers formatted with commas (using ((formatnum:))) and true minus signs.
|format=gaps
gives numbers formatted with thin spaces (using ((val))) and true minus signs.
For reasons of retrospective compatibility, the default when inputting dates as year, month and day is |format=raw; however when inputting dates in full it is |format=commas.
Note
↑Negative days will occur if the first date is after the second.
As noted above, date parameters left undefined default to their current value. Note that this is the current UTC value. Instead of leaving the parameter blank, however, an offset may be added, for example, ((age in days|28 December 2007|+ 5 hours 45 min)) will give the number of days since the king of Nepal was deposed.[dubious – discuss] Note that this will only work when entering full dates (e.g. ((age in days|2007|12|28|+ 5 hours 45 min)) will produce an error message).
Combines functions of ((birth date)), ((birth-date)), ((birth date and age)), ((birth year and age)), ((death date)), ((death-date)), ((death date and age)) and ((death year and age)).