(Created page with "<includeonly>Category:Time Template</includeonly> ==Age== {{Template|Age}} ===Usage=== ===Returns=== {{Code|<nowiki>{{Age|1979/11/05}}</nowiki>}} returns: {{Returns|{{Age|1979/11/05}}}}") |
No edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly>[[Category:Time Template]]</includeonly> | <includeonly>[[Category:Time Template]]</includeonly> | ||
{{Template|Age}} is used to determine how old something is in years. | |||
{{Template|Age}} | ==Usage== | ||
It has one {{Parameter|mandatory}} and accepts one {{Parameter|optional}}, both of which are dates. The built-in MediaWiki functions it relies on should be fairly robust, but the preferred format is: {{Code|yyyy/mm/dd}}. | |||
# is the date of the event in question. | |||
{{Code|<nowiki>{{Age|1979/11/05}}</nowiki>}} returns: {{ | # is the date measured from; it defaults to the contents of [[Game Date]]. | ||
==Returns== | |||
{{Code|<nowiki>{{Age|1979/11/05}}</nowiki>}} returns: {{Return|{{Age|1979/11/05}}}} | |||
{{Code|<nowiki>{{Age|1979/11/05|</nowiki>{{#time:Y/m/d|{{CURRENTTIMESTAMP}}}}<nowiki>}}</nowiki>}} returns: {{Return|{{Age|1979/11/05|{{#time:Y/m/d|{{CURRENTTIMESTAMP}}}}}}}} | |||
Latest revision as of 16:16, 25 January 2024
Template:Age is used to determine how old something is in years.
Usage
It has one mandatory parameter and accepts one optional parameter, both of which are dates. The built-in MediaWiki functions it relies on should be fairly robust, but the preferred format is: yyyy/mm/dd.
- is the date of the event in question.
- is the date measured from; it defaults to the contents of Game Date.
Returns
{{Age|1979/11/05}} returns:
80
{{Age|1979/11/05|2026/06/04}} returns:
46
