قالب:Age in years and days

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.

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}} → 14 سنة, 9 يوم
  • {{age in years and days|12 Aug 2003|24 Sep 2011}} → 8 سنة, 43 يوم
  • {{age in years and days|1989|7|23}} → 34 سنة, 306 يوم
  • {{age in years and days|1989|7|23|2003|7|24}} → 14 سنة, 1 يوم
  • {{age in years and days|2007-03-02|2008-03-02}} → 1 سنة, 0 يوم
  • {{age in years and days|1999-11-07|2112-02-15}} → 112 سنة, 100 يوم

An error is shown if an entered date is not valid (1800, 1900 and 2100 were not leap years).

  • {{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 سنة, 365 يوم
  • {{age in years and days|1 Jan 2011|31 Dec 2012|sep=and}} → 1 سنة و 365 يوم
  • {{age in years and days|1 Jan 2011|31 Dec 2012|duration=on}} → 2 سنة, 0 يوم

TemplateData

Returns the number of full years and surplus days between two specified dates (or, if only one date is entered, between the specified date and today's date)

وسائط القالب

هذا القالب يفضل التنسيق بنفس السطر للوسائط.

وسيطوصفنوعحالة
Earlier date1

The earlier date being compared

تاريخمطلوب
Later date2

The later date being compared

غيابي
Today's date
تاريخمقترح
Separatorsep

Defines a custom separator between the years and days

القيم المقترحة
and
غيابي
,
نصاختياري
Duration?duration

Set to "on" to include the second date in the calculation; will return a result one higher than if left off

بوليانياختياري
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