Template:Age

From Terraria Wiki
Jump to navigation Jump to search
Template-info.svg Documentation The documentation below is transcluded from Template:Age/doc. (edit | history)

This template is used to display the difference between two dates in years. It is mainly used to display an automatically updated number of years that have passed since a certain date, for instance, in the age parameter of {{user infobox}} template calls.

Usage

{{ age | <year (older date)> | <month (older date)> | <day (older date)> | <year (newer date)> (optional) | <month (newer date)> (optional) | <day (newer date)> (optional) }}

First, second, and third unnamed parameters

The older of the two dates to compare. For the age of a user, for instance, this would be the user's birthday.

Fourth, fifth, and sixth unnamed parameters

The newer of the two dates to compare. This defaults to the current date (2024|03|28).

Notes

  • All number may omit leading zeros.
  • If the "older date" is actually the newer one, the template will display a negative number.

Examples

Code Result
{{age|1983|11|12}} 40
{{age|1983|11|12 | 2011|05|16}} 27
{{age|2015|06|30}} 8
{{age|2015|06|30 | 2016|06|29}} 0
{{age|2034|03|28}} -10