ਫਰਮਾ:Age in years and days
ਇਹ ਫਰਮਾ ਹੇਠ ਲਿਖੇ ਲੂਆ ਨੂੰ ਵਰਤਦਾ ਹੈ: |
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 ਸਾਲ, 154 ਦਿਨ{{age in years and days|12 Aug 2003|24 Sep 2011}}
→ 8 ਸਾਲ, 43 ਦਿਨ{{age in years and days|1989|7|23}}
→ 35 ਸਾਲ, 85 ਦਿਨ{{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 ਦਿਨ
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 ਸਾਲ, 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 date | 1 | The earlier date being compared | Date | required |
Later date | 2 | The later date being compared
| Date | suggested |
Separator | sep | Defines a custom separator between the years and days
| String | optional |
Duration? | duration | Set to "on" to include the second date in the calculation; will return a result one higher than if left off | Boolean | optional |