قالب:Age in years and days nts

Template documentation[view] [edit] [history] [purge]

This template returns the number of full years and surplus days between two specified dates. If only one date is entered, the template returns the number of full years and surplus days between the specified date and today's date.

A hidden sort key is included so values produced by this template will work properly in sortable tables. The sort key is calculated from the number of days between the given dates, and is compatible with {{number table sorting}}.

This is temporary documentation resulting from Template talk:Age in years and days#Google problems which shows problems when {{age in years and days}} outputs a hidden sort key. It is proposed that {{age in years and days}} will not output a hidden sort key, so {{age in years and days nts}} is needed for when a sort key is wanted.

Usage

For convenience, the redirect {{ayd}} can be used. Each date can be entered in a single parameter, or each date can be entered as three parameters (year, month, day).

  • {{ayd|15 May 2010}}14 years, 186 days
  • {{ayd|12 Aug 2003|24 Sep 2011}}8 years, 43 days
  • {{ayd|1989|7|23}}35 years, 117 days
  • {{ayd|1989|7|23|2003|7|24}}14 years, 1 days
  • {{ayd|2007|03|02|2008|03|02}}1 years, 0 day

An error is shown if an entered date is not valid (1900 was not a leap year).

  • {{ayd|31 January 1892|29 February 1900}}Error: Second date should be year, month, day
Birth, death, age
  • {{Birth date}} – displays the date and related hidden metadata
  • {{Birth date and age}} – same as {{Birth date}}, except that "(age ##)" appears after the birth date
  • {{Birth date and age2}} – displays birth date, plus age as of a specified date, "(aged ##)" appears after the birth date
  • {{Birth-date and age}} – display birth date and age, accepts dates as text (15 June 1950; June 15, 1950; June 1950; etc.)
  • {{Birth year and age}} – year of birth and approximate age
  • {{Birth based on age as of date}} – displays approximate birth year and current age; used when a dated reference mentions the age of a person as of the date of publication
  • {{Birth date based on age at death}} – displays approximate birth year based on age at death (useful if exact birth date is not known, but age at death is)
  • {{Death date}} – displays the date and related hidden metadata
  • {{Death date and age}} – same as {{Death date}}, except that "(aged ##)" appears after the death date
  • {{Death-date and age}} – display death date and age, accepts date as text (15 June 1950; June 15, 1950; June 1950; etc.)
  • {{Death date and given age}} – displays death date and specified age (useful if exact birth date is not known, but age at death is)
  • {{Death year and age}} – year of death and approximate age at death
Age only
  • {{Age}} – age based on the number of full years between two dates (or a specified date and current date)
  • {{Age nts}} – like {{Age}}, but sorts correctly in sortable tables
  • {{Age as of date}} – current age in years, based on a known age as of a specified date
  • {{Age in years and days}} – full years and days between two dates (or a specified date and current date)
  • {{Age in years and days textual version}} – for usage in text (uses "and" instead of the comma)
  • {{Age in years, months and days}} – full years, months and days between two dates (or a specified date and current date)
  • {{Age in days}} – age in days between two dates (or a specified date and current date)
  • {{Age in days nts}} – age in days; sorts correctly in sortable tables