Template:Age: Difference between revisions
From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
No edit summary |
mNo edit summary |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
This template returns the number of full years between two specified dates. If the second parameter is not included, it will return the number of full years between a specified date and today's date. | This template returns the number of full years between two specified dates. If the second parameter is not included, it will return the number of full years between a specified date and today's date. | ||
==Usage== | |||
<pre> | |||
{{age|date1}} | |||
{{age|date1|date2}} | |||
</pre> | |||
<code><nowiki>{{age|November 23, 1990}}</nowiki></code> returns "{{age|November 23, 1990}}" | |||
<code><nowiki>{{age|November 23, 1990|August 12, 2005}}</nowiki></code> returns "{{age|November 23, 1990|August 12, 2005}}" | |||
===Date formatting=== | |||
: | The full range of possible date formats is based on php's <code>strtotime()</code> function and is explained [https://www.php.net/manual/en/datetime.formats.php here], but for simplicity it's usually best to just stick to the format above. | ||
:<code><nowiki>{{age|November 23 1990}}</nowiki></code> returns "{{age|November 23 1990}}" | |||
:<code><nowiki>{{age|23 November 1990}}</nowiki></code> returns "{{age|23 November 1990}}" | |||
:<code><nowiki>{{age|1990-11-23}}</nowiki></code> returns "{{age|1990-11-23}}" | |||
[[Category:Formatting templates]]</noinclude> | [[Category:Formatting templates]]</noinclude> |
Latest revision as of 08:50, June 10, 2024
This template returns the number of full years between two specified dates. If the second parameter is not included, it will return the number of full years between a specified date and today's date.
Usage
{{age|date1}} {{age|date1|date2}}
{{age|November 23, 1990}}
returns "34"
{{age|November 23, 1990|August 12, 2005}}
returns "14"
Date formatting
The full range of possible date formats is based on php's strtotime()
function and is explained here, but for simplicity it's usually best to just stick to the format above.
{{age|November 23 1990}}
returns "34"{{age|23 November 1990}}
returns "34"{{age|1990-11-23}}
returns "34"