सामग्रीमा जानुहोस्

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

विकिपिडिया, एक स्वतन्त्र विश्वकोशबाट
Content deleted Content added
सा बडा काजी ले ढाँचा:Age in days/doc मा पुनर्निर्देश नछोडि त्यसलाई ढाँचा:Age in days/कागजात मा सारेको हो
 
(२१ प्रयोगकर्ताहरू द्वारा गरिएको बीचको २६ अवतरण देखाइएन)
पङ्क्ति १: पङ्क्ति १:
{{Documentation subpage}}
{{Documentation subpage}}
<!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata -->
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. -->
{{High-use|2348}}
{{Lua|Module:Age}}
{{Template shortcuts|aid}}

This template returns the number of days between two dates. Dates may be input either as full dates or as year, month and day. Omitted parameters to their current value.

==Usage==
==Usage==
====Full dates====
This template returns the number of days between two dates. If the second set of parameters is not included it will automatically calculate the days between a given date and today.
To use, type:
:{|
|-
|<code><nowiki>{{age in days|date1|date2}}</nowiki></code>&nbsp;||(number of days between dates 1 and 2),
|-
|<code><nowiki>{{age in days|date1}}</nowiki></code> ||(number of days since date 1) or
|-
|<code><nowiki>{{age in days||date2}}</nowiki></code> ||(number of days until date 2)
|}


Examples:
To use, type:
:{|
:<nowiki>{{age in days|month1= |day1= |year1= |month2= |day2= | year2=}}</nowiki>
|-
|<code><nowiki>{{age in days|19 Aug 2008|4 Sep 2010}}</nowiki></code> ||gives {{age in days|19 Aug 2008|4 Sep 2010}}
|-
|<code><nowiki>{{age in days|27 May 2002}}</nowiki></code> ||gives {{age in days|27 May 2002}}
|-
|<code><nowiki>{{age in days||{{#time:j M Y|+ 15 months}}}}</nowiki></code>&nbsp;||gives {{age in days||{{#time:j M Y|+ 15 months}}}}
|}


====Year, month and day====
Or with unnamed parameters:
To use, type:
:<nowiki>{{age in days|year1|month1|day1|year2|month2|day2}}</nowiki> or
:{|
:<nowiki>{{age in days|year1|month1|day1}}</nowiki>
|-
|<code><nowiki>{{age in days|year1|month1|day1|year2|month2|day2}}</nowiki></code>&nbsp;||(number of days between dates 1 and 2),
|-
|<code><nowiki>{{age in days|year1|month1|day1}}</nowiki></code> ||(number of days since date 1) or
|-
|<code><nowiki>{{age in days||||year2|month2|day2}}</nowiki></code> ||(number of day until date 2)
|}

Or with named parameters:
:{|
|-
|<code><nowiki>{{age in days|month1= |day1= |year1= |month2= |day2= | year2= }}</nowiki></code>&nbsp;||(number of days between dates 1 and 2),
|-
|<code><nowiki>{{age in days|month1= |day1= |year1= }}</nowiki></code> ||(number of days since date 1) or
|-
|<code><nowiki>{{age in days|month2= |day2= | year2= }}</nowiki></code> ||(number of day until date 2)
|}


Examples:
Examples:
{|
*<nowiki>{{age in days|2007|5|24|2008|4|23}}</nowiki> gives {{age in days|2007|5|24|2008|4|23}}
|-
*<nowiki>{{age in days|2007|5|24}}</nowiki> gives {{age in days|2007|5|24}}
|<code><nowiki>{{age in days|2007|5|24|2008|4|23}}</nowiki></code>&nbsp;||gives {{age in days|2007|5|24|2008|4|23}}
|-
|<code><nowiki>{{age in days|2007|5|24}}</nowiki></code> ||gives {{age in days|2007|5|24}}
|}


== See also ==
===Sorting===
By adding {{para|sortable|on}} a sort key will be added to the output for use in sortable tables. The sort key is produced by {{tl|nts}} and is based on the SI unit of time (the second).
* {{tl|age}} — Age in years

* {{tl|age in years and days}} — Age in years and days
===Formatting===
* {{tl|birth date and age}}
Three styles of formatting are possible.
* {{tl|Age in days nts}} — Like this template, but will sort correctly in sortable tables.
:{|
* {{tl|time ago}}
|-
|{{para|format|raw}} ||gives unformatted numbers with hyphens as minus signs<ref>Negative days will occur if the first date is after the second.</ref> (for use in further calculations).
|-
|{{para|format|commas}}&nbsp;||gives numbers formatted with commas (using <code><nowiki>{{formatnum:}}</nowiki></code>) and true minus signs.
|-
|{{para|format|gaps}} ||gives numbers formatted with thin spaces (using {{tl|val}}) and true minus signs.
|}

For reasons of retrospective compatibility, the default when inputting dates as year, month and day is {{para|format|raw}}; however when inputting dates in full it is {{para|format|commas}}.

:Note
{{Reflist}}

===Showing the unit===
The default is not to show units. To show the unit ("day", days" or "d") use {{para|show unit}}.

:{|
|-
|{{para|show unit|abbr}}&nbsp;||adds "d" after the number of days.
|-
|{{para|show unit|full}} ||adds "day" or "days" after the number of days as appropriate.
|}

===Rounding===
The template rounds down to the nearest number of full days.

===Time zones===
As noted above, date parameters left undefined default to their current value. Note that this is the current UTC value. Instead of leaving the parameter blank, however, an offset may be added, {{nowrap|for example, <code><nowiki>{{age in days|28 December 2007|+ 5 hours 45 min}}</nowiki></code>}} will give the number of days since the [[king of Nepal]] was deposed.{{dubious}} Note that this will only work when entering full dates {{nowrap|(e.g. <code><nowiki>{{age in days|2007|12|28|+ 5 hours 45 min}}</nowiki></code>}} will produce an error message).

==See also==
{{Commons|Template:Age in days}}
* [[Wikipedia:Age calculation templates]]
* [[Wikipedia:Age calculation templates]]
* {{tl|Duration in days}}
* {{tl|Time ago}}

{{Birth, death and age templates|age}}


<includeonly><!--
<includeonly>{{sandbox other||
<!-- Categories below this line and interwikis at Wikidata -->
++++ PLEASE ADD CATEGORIES AND INTERWIKIS BELOW THIS LINE, THANK YOU. -->
[[Category:Date mathematics templates|{{PAGENAME}}]]
[[Category:Date mathematics templates|{{PAGENAME}}]]
[[Category:Date-computing templates|{{PAGENAME}}]]


}}</includeonly>
[[ar:قالب:Age in days]]
[[be-x-old:Шаблён:Тэрмін у днях]]
[[cs:Šablona:Věk ve dnech]]
[[de:Vorlage:Tagesdifferenz]]
[[es:Plantilla:Edad en días]]
[[dsb:Pśedłoga:Diferenca pó dnjach]]
[[eo:Ŝablono:Tagdiferenco]]
[[fa:الگو:سن به روز]]
[[fr:Modèle:Age en jours]]
[[hsb:Předłoha:Diferenca po dnjach]]
[[is:Snið:Aldur í dögum]]
[[ja:Template:Age in days]]
[[ko:틀:날짜세기]]
[[hu:Sablon:Age in days]]
[[nl:Sjabloon:Aantal dagen]]
[[pt:Predefinição:Idade em dias]]
[[ru:Шаблон:Days between]]
[[uk:Шаблон:Age in days]]
[[vi:Tiêu bản:Tuổi theo ngày]]
</includeonly>

१८:२३, ११ अप्रिल २०२३को रुपमा हालको पुनरावलोकनहरू

This template returns the number of days between two dates. Dates may be input either as full dates or as year, month and day. Omitted parameters to their current value.

To use, type:

{{age in days|date1|date2}}  (number of days between dates 1 and 2),
{{age in days|date1}} (number of days since date 1) or
{{age in days||date2}} (number of days until date 2)

Examples:

{{age in days|19 Aug 2008|4 Sep 2010}} gives ७४६
{{age in days|27 May 2002}} gives ८,२६३
{{age in days||{{#time:j M Y|+ 15 months}}}}  gives ४५५

To use, type:

{{age in days|year1|month1|day1|year2|month2|day2}}  (number of days between dates 1 and 2),
{{age in days|year1|month1|day1}} (number of days since date 1) or
{{age in days||||year2|month2|day2}} (number of day until date 2)

Or with named parameters:

{{age in days|month1= |day1= |year1= |month2= |day2= | year2= }}  (number of days between dates 1 and 2),
{{age in days|month1= |day1= |year1= }} (number of days since date 1) or
{{age in days|month2= |day2= | year2= }} (number of day until date 2)

Examples:

{{age in days|2007|5|24|2008|4|23}}  gives ३३५
{{age in days|2007|5|24}} gives ६४४०

By adding |sortable=on a sort key will be added to the output for use in sortable tables. The sort key is produced by {{nts}} and is based on the SI unit of time (the second).

Three styles of formatting are possible.

|format=raw gives unformatted numbers with hyphens as minus signs[] (for use in further calculations).
|format=commas  gives numbers formatted with commas (using {{formatnum:}}) and true minus signs.
|format=gaps gives numbers formatted with thin spaces (using {{val}}) and true minus signs.

For reasons of retrospective compatibility, the default when inputting dates as year, month and day is |format=raw; however when inputting dates in full it is |format=commas.

Note
  1. Negative days will occur if the first date is after the second.

The default is not to show units. To show the unit ("day", days" or "d") use |show unit=.

|show unit=abbr  adds "d" after the number of days.
|show unit=full adds "day" or "days" after the number of days as appropriate.

The template rounds down to the nearest number of full days.

As noted above, date parameters left undefined default to their current value. Note that this is the current UTC value. Instead of leaving the parameter blank, however, an offset may be added, for example, {{age in days|28 December 2007|+ 5 hours 45 min}} will give the number of days since the king of Nepal was deposed.[dubious] Note that this will only work when entering full dates (e.g. {{age in days|2007|12|28|+ 5 hours 45 min}} will produce an error message).