Template:Age: Difference between revisions

From Destinypedia, the Destiny wiki

(Created page with "<includeonly>{{#expr:({{#time:Y|{{{2|{{CURRENTTIMESTAMP}}}}}}})-({{#time:Y|{{{1}}}}})-(({{#time:m|{{{2|{{CURRENTTIMESTAMP}}}}}}})<({{#time:m|{{{1}}}}})or({{#time:m|{{{2|{{CURRENTTIMESTAMP}}}}}}})=({{#time:m|{{{1}}}}})and({{#time:d|{{{2|{{CURRENTTIMESTAMP}}}}}}})<({{#time:d|{{{1}}}}}))}}</includeonly><noinclude> 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 betwe...")
 
m (Protected "Template:Age" ([Edit=Allow only Destinypedia staff] (indefinite) [Move=Allow only Destinypedia staff] (indefinite)))
 

Latest revision as of 09:08, 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"