Template:Age years months/doc
Jump to navigation
Jump to search
This template prints the timespan (in years and months, rounded down) between two dates.
Usage
{{age years months | <year> | <month> | <day> | <year 2> | <month 2> | <day 2> }}
- Unnamed parameters 1–3
The first date. Default is 1970-01-01.
- Unnamed parameters 4–6
The second date. Default is the current date (2024-05-3).
Notes
- When using two dates, the more recent one needs to be entered as the parameters 4–6 in order to avoid errors.
Examples
Code | Result |
---|---|
{{age years months|2011|05|16}} |
12 years and 11 months |
{{age years months|2011|05|16|2015|06|30}} |
4 years and 1 month |
{{age years months|2015|06|30|2011|05|16}} |
-4 years and 10 months (error – do not use it this way!) |
{{age years months}} |
54 years and 4 months |