Template:Age in days/doc

This template returns the number of days between two dates. Dates may be input either as full dates or as year, month and day.

Full dates
To use, type:


 * ||(number of days between dates 1 and 2),
 * ||(number of days since date 1) or
 * ||(number of days until date 2)
 * }
 * ||(number of days until date 2)
 * }
 * }

Examples:


 * ||gives
 * ||gives
 * ||gives 8945 days
 * }
 * ||gives 8945 days
 * }
 * }

Year, month and day
To use, type:


 * ||(number of days between dates 1 and 2),
 * ||(number of days since date 1) or
 * ||(number of day until date 2)
 * }
 * ||(number of day until date 2)
 * }
 * }

Or with named parameters:


 * ||(number of days between dates 1 and 2),
 * ||(number of days since date 1) or
 * ||(number of day until date 2)
 * }
 * ||(number of day until date 2)
 * }
 * }

Examples:

Sorting
By adding on a sort key will be added to the output for use in sortable tables.

Formatting
Three styles of formatting are possible.


 * raw        ||gives unformatted numbers with hyphens as minus signs (for use in further calculations).
 * commas ||gives numbers formatted with commas and true minus signs.
 * }
 * commas ||gives numbers formatted with commas and true minus signs.
 * }

For reasons of retrospective compatibility, the default when inputting dates as year, month and day is raw; however when inputting dates in full it is commas.


 * Note

Showing the unit
The default is not to show units. To show the unit ("day", days" or "d") use show unit.




 * abbr ||adds "d" after the number of days.
 * full     ||adds "day" or "days" after the number of days as appropriate.
 * }
 * full     ||adds "day" or "days" after the number of days as appropriate.
 * }