ទំព័រគំរូ:Age in years and days

ពីវិគីភីឌា
Jump to navigation Jump to search
ឯកសារកម្មទំព័រគំរូ[មើល] [កែ] [ប្រវត្តិ] [ជម្រុះ]

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.

This template does not generate a sort key. In a sortable table, use {{ayd}} which redirects to {{age in years and days nts}}.

Usage[កែប្រែ]

Each date can be entered in a single parameter, or each date can be entered as three parameters: year, month, day.

  • {{age in years and days|15 May 2010}} → 11 years, 156 days
  • {{age in years and days|12 Aug 2003|24 Sep 2011}} → 8 years, 43 days
  • {{age in years and days|1989|7|23}} → 32 years, 87 days
  • {{age in years and days|1989|7|23|2003|7|24}} → 14 years, 1 day
  • {{age in years and days|2007-03-02|2008-03-02}} → 1 year, 0 days

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

  • {{age in years and days|31 January 1892|29 February 1900}}Error: Second date should be year, month, day

Options[កែប្រែ]

The default is to separate years and days with a comma. The separator is "and" if |sep=and is used.

The default calculates an age—the day of the second date is not included in the calculation. A duration including the second date is calculated if |duration=on is used.

  • {{age in years and days|1 Jan 2011|31 Dec 2012}} → 1 year, 365 days
  • {{age in years and days|1 Jan 2011|31 Dec 2012|sep=and}} → 1 year and 365 days
  • {{age in years and days|1 Jan 2011|31 Dec 2012|duration=on}} → 2 years, 0 days


Birth, death, age
{{BirthDeathAge}} – carries out the functions of this template and all the following ones
{{Birth date}} – displays the date and related hidden metadata
{{Birth date and age2}} – displays birth date, plus age as of a specified date, "(aged ##)" appears after the birth date
{{Birth year and age}} – year of birth and approximate age
{{Birth-date and age}} – display birth date and age, accepts dates as text (15 June 1950; June 15, 1950; June 1950; etc.)
{{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
{{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 year and age}} – year of death and approximate age at death
{{Death-date and age}} – display death date and age, accepts date as text (15 June 1950; June 15, 1950; June 1950; etc.)
Age only
{{Age}} – age based on the number of full years between two dates (or a specified date and current date)
{{Age nts}} – similar to the above, but will sort correctly in sortable tables
{{Age in years and days}} – full years 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 as of date}} – current age in years, based on a known age as of a specified date

ទំព័រគំរូ:Sandbox other