Changes
add {{Lua|Module:Age}}, misc formatting
{{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).
== 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>
: <code><nowiki>{{</nowiki>age in months<nowiki>|</nowiki></code>''date1''<code><nowiki>}}</nowiki></code>
: <code><nowiki>{{</nowiki>age in months<nowiki>|</nowiki></code>''date1''<code><nowiki>|</nowiki></code>''date2''<code><nowiki>}}</nowiki></code>
== 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|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>{{</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>{{sandbox other||
<!-- Categories below this line and interwikis at Wikidata -->
[[Category:Date mathematics templates|{{PAGENAME}}]]
}}</includeonly>
<!-- 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).
== 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>
: <code><nowiki>{{</nowiki>age in months<nowiki>|</nowiki></code>''date1''<code><nowiki>}}</nowiki></code>
: <code><nowiki>{{</nowiki>age in months<nowiki>|</nowiki></code>''date1''<code><nowiki>|</nowiki></code>''date2''<code><nowiki>}}</nowiki></code>
== 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|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>{{</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>{{sandbox other||
<!-- Categories below this line and interwikis at Wikidata -->
[[Category:Date mathematics templates|{{PAGENAME}}]]
}}</includeonly>