Template:Age in days: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
No edit summary
No edit summary
Line 7: Line 7:
{{age in days|date1|date2}}
{{age in days|date1|date2}}
</pre>
</pre>
<code><nowiki>{{age in days|November 23, 1990|August 12, 2005}}</nowiki></code> returns "{{age in days|November 23, 1990|August 12, 2005}}"


<code><nowiki>{{age in days|August 12, 2005}}</nowiki></code> returns "{{age in days|August 12, 2005}}"
<code><nowiki>{{age in days|August 12, 2005}}</nowiki></code> returns "{{age in days|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 in days|August 12 2005}}</nowiki></code> returns "{{age in days|August 12 2005}}"
:<code><nowiki>{{age in days|12 August 2005}}</nowiki></code> returns "{{age in days|12 August 2005}}"
:<code><nowiki>{{age in days|2005-08-12}}</nowiki></code> returns "{{age in days|2005-08-12}}"


[[Category:Formatting templates]]</noinclude>
[[Category:Formatting templates]]</noinclude>

Revision as of 06:12, July 14, 2024

This template returns the number of days between two specified dates. If the second parameter is not included, it will return the number of days between a specified date and today's date.

Usage

{{age in days|date1}}
{{age in days|date1|date2}}

{{age in days|November 23, 1990|August 12, 2005}} returns "5376"

{{age in days|August 12, 2005}} returns "7111"

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 in days|August 12 2005}} returns "7111"
{{age in days|12 August 2005}} returns "7111"
{{age in days|2005-08-12}} returns "7111"