قالب:العمر بالأيام
هذا القالب يستعمل لوا: |
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. gives
الاستخدام
Full dates
To use, type:
{{العمر بالأيام|date1|date2}}
(number of days between dates 1 and 2), {{العمر بالأيام|date1}}
(number of days since date 1) or {{العمر بالأيام||date2}}
(number of days until date 2)
Examples:
{{age in days|19 Aug 2008|4 Sep 2010}}
ينتج: ← 746{{age in days|27 May 2002}}
ينتج: ← 8,194{{age in days||١ فبراير ٢٠٢٦}}
ينتج: ← خطأ: Second date should be year, month, day
Year, month and day
To use, type:
{{العمر بالأيام|year1|month1|day1|year2|month2|day2}}
(number of days between dates 1 and 2), {{العمر بالأيام|year1|month1|day1}}
(number of days since date 1) or {{العمر بالأيام||||year2|month2|day2}}
(number of day until date 2)
Or with named parameters:
{{العمر بالأيام|month1= |day1= |year1= |month2= |day2= | year2=}}
(number of days between dates 1 and 2), {{العمر بالأيام|month1= |day1= |year1=}}
(number of days since date 1) or {{العمر بالأيام|month2= |day2= | year2=}}
(number of day until date 2)
Examples:
{{age in days|2007|5|24|2008|4|23}}
ينتج: ← 335{{age in days|2007|5|24}}
ينتج: ← 6371
Sorting
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).
Formatting
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
- ↑ Negative days will occur if the first date is after the second.
Showing the unit
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.
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, for example, {{العمر بالأيام|28 December 2007|+ 5 hours 45 min}}
will give the number of days since the قائمة ملوك نيبال was deposed.[محل شك] Note that this will only work when entering full dates (e.g. {{العمر بالأيام|2007|12|28|+ 5 hours 45 min}}
will produce an error message).
طالع أيضاً
|
التوثيق في الأعلى مضمن من قالب:العمر بالأيام/شرح. (عدّل | تاريخ) يمكن للمحررين تجريب تعديلاتهم على القالب في صفحات ملعب (أنشئ | مرآة) ومختبر (أنشئ). من فضلك أضف التصنيفات في الصفحة الفرعية للقالب /شرح. الصفحات الفرعية لـ قالب. |