"ढाँचा:Age in years, months and days/कागजात" का संशोधनहरू बिचको अन्तर

expand
पङ्क्ति १:
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
{{esoteric}}
This template returns the number of full years, then surplus months, then surplus days between two specified dates. If the second set of parameters is not included, it will return the number of years, months and days between a specified date and today's date. The years and months are separated by a comma; since [[MOS:SERIAL|serial commas are optional]] and use varies, this template does not automatically place a comma after month. The words "year", "month" and "day" are plural when appropriate. See [[Wikipedia:Age calculation templates]] for more information on using this kind of template.
=== Usage ===
 
<table class="wikitable">
===Syntax===
<tr>
:<code><nowiki>{{Age in years, months and days|year= |month= |day= }}</nowiki></code> or
<th>Code</th><th>Result</th>
:<code><nowiki>{{Age in years, months and days|yyyy|mm|dd|yyyy2|mm2|dd2}}</nowiki></code>
</tr>
 
<tr>
=== Examples ===
:<tdcode><nowiki>{{ForAge yearin monthyears, daymonths and days|year=20042001|month=31|day=1015}}</nowiki></td><tdcode> returns "{{ForAge yearin monthyears, daymonths and days|year=20042001|month=31|day=1015}}</td>"
</tr>
:<code><nowiki>{{Age in years, months and days|2001|01|15|2008|09|05}}</nowiki></code> returns "{{Age in years, months and days|2001|01|15|2008|09|05}}"
<tr>
:<tdcode><nowiki>{{ForAge yearin monthyears, daymonths and days|2016|8|4|year=20062016|month=099|day=025}}</nowiki></td><tdcode> returns "{{ForAge yearin monthyears, daymonths and days|year=20062016|month=098|day=024|2016|9|5}}</td>"
 
</tr>
=== UsageNotes ===
<tr>
This template can handle an ambiguous start date:
<td><nowiki>{{For year month day|</nowiki>year={{CURRENTYEAR}}|month={{ #ifeq: {{CURRENTMONTH}}|1|12|{{ #expr:{{CURRENTMONTH}}-1 }} }}|day={{ #ifeq: {{CURRENTDAY}}|1|28|{{ #expr:{{CURRENTDAY}} -1}}}}<nowiki>}}</nowiki></td><td>{{For year month day|year={{CURRENTYEAR}}|month={{ #ifeq: {{CURRENTMONTH}}|1|12|{{ #expr:{{CURRENTMONTH}}-1 }} }}|day={{ #ifeq: {{CURRENTDAY}}|1|28|{{ #expr:{{CURRENTDAY}} -1}} }}}}</td>
:<code><nowiki>{{Age in years, months and days|year=2010|month=9}}</nowiki></code> returns "{{Age in years, months and days|year=2010|month=9}}"
</tr>
:<code><nowiki>{{Age in years, months and days|2009|6||2011|2|21}}</nowiki></code> returns "{{Age in years, months and days|2009|6||2011|2|21}}"
</table>
But it cannot handle an ambiguous end date:
:<code><nowiki>{{Age in years, months and days|2012|11|2|2016|4}}</nowiki></code> returns "{{Age in years, months and days|2012|11|2|2016|4}}"
:<code><nowiki>{{Age in years, months and days|2012|11|2|2017}}</nowiki></code> returns "{{Age in years, months and days|2012|11|2|2017}}"
Since the length of a month varies, the number of days to roll over the number of months varies.
:<code><nowiki>{{Age in years, months and days|2007|3|12|2015|6|11}}</nowiki></code> returns "{{Age in years, months and days|2007|3|12|2015|6|11}}"
:<code><nowiki>{{Age in years, months and days|2007|3|12|2015|7|11}}</nowiki></code> returns "{{Age in years, months and days|2007|3|12|2015|7|11}}"
To add a [[serial comma]] specify {{para|sc|y}}.
:<code><nowiki>{{Age in years, months and days|year=2001|month=1|day=15|sc=y}}</nowiki></code> returns "{{Age in years, months and days|year=2001|month=1|day=15|sc=y}}"
:<code><nowiki>{{Age in years, months and days|2001|1|15|2008|9|5|sc=y}}</nowiki></code> returns "{{Age in years, months and days|2001|1|15|2008|9|5|sc=y}}"
:<code><nowiki>{{Age in years, months and days|</nowiki>{{#ifexpr:{{#time:z|{{CURRENTMONTHNAME}} {{CURRENTDAY}}}}<14|{{#expr:{{CURRENTYEAR}}-8}}|{{#ifexpr:{{#time:z|{{CURRENTMONTHNAME}} {{CURRENTDAY}}}}<45|2006|{{#expr:{{CURRENTYEAR}}-8}}}}}}<nowiki>|</nowiki>{{#ifexpr:{{#time:z|{{CURRENTMONTHNAME}} {{CURRENTDAY}}}}<14|12|{{#ifexpr:{{#time:z|{{CURRENTMONTHNAME}} {{CURRENTDAY}}}}<45|8|{{#ifexpr:{{CURRENTDAY}}<15|{{#expr:{{CURRENTMONTH}}-1}}|{{CURRENTMONTH}}}}}}}}<nowiki>|</nowiki>{{#ifexpr:{{#time:z|{{CURRENTMONTHNAME}} {{CURRENTDAY}}}}<14|{{#ifexpr:{{CURRENTDAY}}<15|{{#expr:{{CURRENTDAY}}+15}}|{{#expr:{{CURRENTDAY}}-14}}}}|{{#ifexpr:{{#time:z|{{CURRENTMONTHNAME}} {{CURRENTDAY}}}}<4|4|{{#ifexpr:{{CURRENTDAY}}<15|{{#expr:{{CURRENTDAY}}+15}}|{{#expr:{{CURRENTDAY}}-14}}}}}}}}<nowiki>|sc=y}}</nowiki></code> returns "{{Age in years, months and days| {{#ifexpr:{{#time:z|{{CURRENTMONTHNAME}} {{CURRENTDAY}}}}<14|{{#expr:{{CURRENTYEAR}}-8}}|{{#ifexpr:{{#time:z|{{CURRENTMONTHNAME}} {{CURRENTDAY}}}}<45|2006|{{#expr:{{CURRENTYEAR}}-8}}}}}}|{{#ifexpr:{{#time:z|{{CURRENTMONTHNAME}} {{CURRENTDAY}}}}<14|12|{{#ifexpr:{{#time:z|{{CURRENTMONTHNAME}} {{CURRENTDAY}}}}<45|8|{{#ifexpr:{{CURRENTDAY}}<15|{{#expr:{{CURRENTMONTH}}-1}}|{{CURRENTMONTH}}}}}}}}|{{#ifexpr:{{#time:z|{{CURRENTMONTHNAME}} {{CURRENTDAY}}}}<14|{{#ifexpr:{{CURRENTDAY}}<15|{{#expr:{{CURRENTDAY}}+15}}|{{#expr:{{CURRENTDAY}}-14}}}}|{{#ifexpr:{{#time:z|{{CURRENTMONTHNAME}} {{CURRENTDAY}}}}<4|4|{{#ifexpr:{{CURRENTDAY}}<15|{{#expr:{{CURRENTDAY}}+15}}|{{#expr:{{CURRENTDAY}}-14}}}}}}}}|sc=y}}"
 
=== See also ===
*[[Wikipedia:Age calculation templates]]
* {{tl|User Wikipedian For}}
* {{tl|User admin since}}
{{Birth, death and age templates}}
* {{tl|User admin somewhere since}}
* {{tl|User bureaucrat since}}
* {{tlu|User:Nsaa/Userboxes/bureaucrat somewhere since}}
* {{tlu|User:Deskana/Userboxes/checkuser since}}
 
<includeonly>
Line ३० ⟶ ३७:
[[Category:Date-computing templates|{{PAGENAME}}]]
 
[[as:সাঁচ:ForAge yearin monthyears, daymonths and days]]
[[bn:টেমপ্লেট:ForAge yearin monthyears, daymonths and days]]
[[hy:Կաղապար:Տևողություն]]
[[id:Templat:Untuk tahun bulan hari]]
[[ja:Template:ForAge yearin monthyears, daymonths and days]]
[[no:Mal:For år måned dag]]
[[ru:Шаблон:Продолжительность]]