Template:Age: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
m (Changed protection settings for "Template:Age": being in your 30's is actually cool and good ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
No edit summary
Line 3: Line 3:


;Syntax<nowiki>:</nowiki>
;Syntax<nowiki>:</nowiki>
:<nowiki>{{age|date1|date2}}</nowiki> or
:<code><nowiki>{{age|date1|date2}}</nowiki></code> or
:<nowiki>{{age|date1}}</nowiki>
:<code><nowiki>{{age|date1}}</nowiki></code>


;Examples<nowiki>:</nowiki>
;Examples<nowiki>:</nowiki>
:<nowiki>{{age|July 7, 1989|July 14, 2003}}</nowiki> returns "{{age|July 7, 1989|July 14, 2003}}"
:<code><nowiki>{{age|November 23, 1990|August 12, 2005}}</nowiki></code> returns "{{age|November 23, 1990|August 12, 2005}}"
:<nowiki>{{age|July 7, 1989}}</nowiki> returns "{{age|July 7, 1989}}"
:<code><nowiki>{{age|November 23, 1990}}</nowiki></code> returns "{{age|November 23, 1990}}"
 
: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.
:The full range of possible date formats is based on php's strtotime() 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}}"
::<nowiki>{{age|July 7 1989}}</nowiki> returns "{{age|July 7 1989}}"
::<code><nowiki>{{age|23 November 1990}}</nowiki></code> returns "{{age|23 November 1990}}"
::<nowiki>{{age|7 July 1989}}</nowiki> returns "{{age|7 July 1989}}"
::<code><nowiki>{{age|1990-11-23}}</nowiki></code> returns "{{age|1990-11-23}}"
::<nowiki>{{age|1989-7-23}}</nowiki> returns "{{age|1989-7-23}}"


;Note<nowiki>:</nowiki>
;Note<nowiki>:</nowiki>

Revision as of 09:49, May 24, 2023

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.

Syntax:
{{age|date1|date2}} or
{{age|date1}}
Examples:
{{age|November 23, 1990|August 12, 2005}} returns "14"
{{age|November 23, 1990}} returns "34"
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"
Note:
This template does not check for incorrect input.