Difference between revisions of "Template:Age in months/doc"
Jump to navigation
Jump to search
blackwiki>Johnuniq (use code to always generate a valid date) |
blackwiki>Zyxw (add {{Lua|Module:Age}}, misc formatting) |
||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
| + | <!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata --> | ||
| + | {{Lua|Module:Age}} | ||
| + | |||
This template returns the number of full months between two dates, or between a specified date and today (UTC). | This template returns the number of full months between two dates, or between a specified date and today (UTC). | ||
| − | + | == Usage == | |
: <code><nowiki>{{</nowiki>age in months<nowiki>|</nowiki></code>''year1''<code><nowiki>|</nowiki></code>''month1''<code><nowiki>|</nowiki></code>''day1''<code><nowiki>|</nowiki></code>''year2''<code><nowiki>|</nowiki></code>''month2''<code><nowiki>|</nowiki></code>''day2''<code><nowiki>}}</nowiki></code> | : <code><nowiki>{{</nowiki>age in months<nowiki>|</nowiki></code>''year1''<code><nowiki>|</nowiki></code>''month1''<code><nowiki>|</nowiki></code>''day1''<code><nowiki>|</nowiki></code>''year2''<code><nowiki>|</nowiki></code>''month2''<code><nowiki>|</nowiki></code>''day2''<code><nowiki>}}</nowiki></code> | ||
: <code><nowiki>{{</nowiki>age in months<nowiki>|</nowiki></code>''year1''<code><nowiki>|</nowiki></code>''month1''<code><nowiki>|</nowiki></code>''day1''<code><nowiki>}}</nowiki></code> | : <code><nowiki>{{</nowiki>age in months<nowiki>|</nowiki></code>''year1''<code><nowiki>|</nowiki></code>''month1''<code><nowiki>|</nowiki></code>''day1''<code><nowiki>}}</nowiki></code> | ||
| Line 8: | Line 11: | ||
: <code><nowiki>{{</nowiki>age in months<nowiki>|</nowiki></code>''date1''<code><nowiki>|</nowiki></code>''date2''<code><nowiki>}}</nowiki></code> | : <code><nowiki>{{</nowiki>age in months<nowiki>|</nowiki></code>''date1''<code><nowiki>|</nowiki></code>''date2''<code><nowiki>}}</nowiki></code> | ||
| − | Examples | + | == Examples == |
| − | *<nowiki>{{age in months|1970|7|23|2003|7|14}}</nowiki> → {{age in months|1970|7|23|2003|7|14}} | + | * <nowiki>{{age in months|1970|7|23|2003|7|14}}</nowiki> → {{age in months|1970|7|23|2003|7|14}} |
| − | *<nowiki>{{age in months|1989|7|23}}</nowiki> → {{age in months|1989|7|23}} | + | * <nowiki>{{age in months|1989|7|23}}</nowiki> → {{age in months|1989|7|23}} |
| − | *<nowiki>{{age in months|23 July 1989}}</nowiki> → {{age in months|23 July 1989}} | + | * <nowiki>{{age in months|23 July 1989}}</nowiki> → {{age in months|23 July 1989}} |
| − | *<nowiki>{{</nowiki>age in months|{{extract|currentdate|add=-1m 1d}}|{{extract|currentdate}}}} → {{age in months|{{extract|currentdate|add=-1m 1d}}|{{extract|currentdate}}}} | + | * <nowiki>{{</nowiki>age in months|{{extract|currentdate|add=-1m 1d}}|{{extract|currentdate}}}} → {{age in months|{{extract|currentdate|add=-1m 1d}}|{{extract|currentdate}}}} |
| + | If you use this template for calculating someone's age in months at death or age in months at a certain date (rather than their current age in months), please substitute it into the page, for example: <nowiki>{{subst:age in months|1989|7|23|2003|7|14}}</nowiki>. | ||
| − | + | {{Birth, death and age templates|age}} | |
| − | <includeonly> | + | <includeonly>{{sandbox other|| |
| − | <!-- | + | <!-- Categories below this line and interwikis at Wikidata --> |
[[Category:Date mathematics templates|{{PAGENAME}}]] | [[Category:Date mathematics templates|{{PAGENAME}}]] | ||
| − | + | }}</includeonly> | |
| − | |||
| − | |||
| − | |||
| − | </includeonly> | ||
Revision as of 18:43, 23 October 2018
| This is a documentation subpage for Template:Age in months. It contains usage information, categories and other content that is not part of the original template page. |
| 30px | This template uses Lua: |
This template returns the number of full months between two dates, or between a specified date and today (UTC).
Usage
{{age in months|year1|month1|day1|year2|month2|day2}}{{age in months|year1|month1|day1}}{{age in months|date1}}{{age in months|date1|date2}}
Examples
- {{age in months|1970|7|23|2003|7|14}} → 395
- {{age in months|1989|7|23}} → 437
- {{age in months|23 July 1989}} → 437
- {{age in months|21 December 2025|20 January 2026}} → 0
If you use this template for calculating someone's age in months at death or age in months at a certain date (rather than their current age in months), please substitute it into the page, for example: {{subst:age in months|1989|7|23|2003|7|14}}.