پرش به محتوا
منوی اصلی
منوی اصلی
انتقال به نوار کناری
نهفتن
ناوبری
صفحهٔ اصلی
تغییرات اخیر
مقالهٔ تصادفی
راهنما دربارهٔ مدیاویکی
صفحههای ویژه
جستجو
جستجو
ظاهر
ساخت حساب
ورود
ابزارهای شخصی
ساخت حساب
ورود
صفحههایی برای ویرایشگرانی که از سامانه خارج شدند
بیشتر بدانید
مشارکتها
بحث
در حال ویرایش
الگو:Time ago/توضیحات
الگو
بحث
فارسی
خواندن
ویرایش مبدأ
نمایش تاریخچه
ابزارها
ابزارها
انتقال به نوار کناری
نهفتن
کنشها
خواندن
ویرایش مبدأ
نمایش تاریخچه
عمومی
پیوندها به این صفحه
تغییرات مرتبط
اطلاعات صفحه
ظاهر
انتقال به نوار کناری
نهفتن
هشدار:
شما وارد نشدهاید. نشانی آیپی شما برای عموم قابل مشاهده خواهد بود اگر هر تغییری ایجاد کنید. اگر
وارد شوید
یا
یک حساب کاربری بسازید
، ویرایشهایتان به نام کاربریتان نسبت داده خواهد شد، همراه با مزایای دیگر.
بررسی ضدهرزنگاری. این قسمت را پر
نکنید
!
{{Documentation subpage}} {{high-use|119878}} {{lua|Module:Time ago}} <!-- Categories go at the bottom of this page and interwikis go in Wikidata. --> The '''Time ago''' template calculates the amount of time which has passed since a provided timestamp. The result is a string similar to one of the examples below. This template ''should not'' be used with "subst" unless you don't want the stamp to change as the user refreshes the page. Note that due to Wikipedia's caching mechanisms, you may need to [[WP:PURGE|purge]] a page using this template to update the dynamic value. See the section [[#Purge|Purge]] below. The result is rounded down. "Month" is defined as 31 days. == Usage == * <code><nowiki>{{</nowiki>'''Time ago'''|''timestamp''<nowiki>}}</nowiki></code> The timestamp can be almost any solid, readable format but to avoid ambiguity mistakes, one of the styles below is preferred. * <code>magnitude</code> parameter can be set to explicitly use certain unit. Allowed values are: <code>seconds</code>, <code>minutes</code>, <code>hours</code>, <code>days</code>, <code>weeks</code>, <code>months</code> and <code>years</code>. * <code>min_magnitude</code> parameter can be set to use the specified unit or bigger units. Allowed values are: <code>seconds</code>, <code>minutes</code>, <code>hours</code>, <code>days</code>, <code>months</code> and <code>years</code>. * <code>ago</code> parameter can be set to override the default usage of the text "<code>ago</code>". If the parameter is blank but not missing (i.e. <code><nowiki>{{time ago|2008|ago=}}</nowiki></code>), then the text "ago" is suppressed altogether. For future dates, setting "ago" as blank but not missing will suppress the text "time" (i.e. "2 years" instead of "2 years' time"). === Spelling out numbers === Numbers from 1 to 100 can be spelled out in their equivalent English word by using the <code>spellout</code> parameter. If <code>spellout</code> is set to "yes", "y", "true" or "1", all numbers from 1 to 100 will be spelled out. If <code>spellout</code> is set to "auto", only numbers from 1 to 9 will be spelled out, as per the recommendations at [[MOS:NUMERAL]]. It is also possible to set a custom maximum value for spelling out by using the <code>spelloutmax</code> parameter. For example, setting {{para|spellout|yes}} and {{para|spelloutmax|24}} will result in all numbers less than or equal to 24 being spelled out, and all numbers greater than 24 appearing as numerals. === Purge link === Add the parameter {{para|purge|yes}} to add a [[WP:PURGE|purge]] link. == Examples == * {{tlc|Time ago| -83 minutes}} → '''{{Time ago|-83 minutes}}''' * {{tlc|Time ago| -334 minutes}} → '''{{Time ago|-334 minutes}}''' * {{tlc|Time ago| +334 minutes}} → '''{{Time ago|+334 minutes}}''' * {{tlc|Time ago|<nowiki>{{REVISIONTIMESTAMP}}</nowiki>}} → '''{{Time ago|{{REVISIONTIMESTAMP}}}}''' * {{tlc|Time ago| Jan 21, 2001 3:45 PM}} → '''{{Time ago|Jan 21 2001 3:45 PM}}''' * ''Wrong:'' {{tlc|Time ago| 3:45 pm, 21 Jan 2001}} → '''{{Time ago|3:45 pm, 21 Jan 2001}}''' * {{tlc|Time ago|20010121154500}} → '''{{Time ago|20010121154500}}''' * {{tlc|Time ago| Nov 6 2008}} → '''{{Time ago|Nov 6 2008}}''' * {{tlc|Time ago| Nov 6 2008|3=magnitude=weeks}} → '''{{Time ago| Nov 6 2008|magnitude=weeks}}''' * {{tlc|Time ago| Nov 6 2008|3=min_magnitude=days}} → '''{{Time ago|Nov 6 2008|min_magnitude=days}}''' * {{tlc|Time ago| Nov 6 2008|3=min_magnitude=years}} → '''{{Time ago|Nov 6 2008|min_magnitude=years}}''' * {{tlc|Time ago| Nov 6 2008|3=ago=in the past}} → '''{{Time ago|Nov 6 2008|ago=in the past}}''' * {{tlc|Time ago| Nov 6 2008|3=purge=yes}} → '''{{Time ago|Nov 6 2008|purge=yes}}''' * {{tlc|Time ago| 2008-11-06}} → '''{{Time ago|2008-11-06}}''' * <code><nowiki>{{Time ago| June 1, 2009|spellout=yes}}</nowiki></code> → '''{{time ago|June 1, 2009|spellout=yes}}''' * <code><nowiki>{{Time ago| June 1, 1999|spellout=yes}}</nowiki></code> → '''{{time ago|June 1, 1999|spellout=yes}}''' * <code><nowiki>{{Time ago| June 1, 2009|spellout=auto}}</nowiki></code> → '''{{time ago|June 1, 2009|spellout=auto}}''' * <code><nowiki>{{Time ago| June 1, 1999|spellout=auto}}</nowiki></code> → '''{{time ago|June 1, 1999|spellout=auto}}''' * <code><nowiki>{{Time ago| June 1, 1989|spellout=yes|spelloutmax=15}}</nowiki></code> → '''{{time ago|June 1, 1989|spellout=yes|spelloutmax=15}}''' * <code><nowiki>{{Time ago| June 1, 1989|spellout=yes|spelloutmax=25}}</nowiki></code> → '''{{time ago|June 1, 1989|spellout=yes|spelloutmax=25}}''' * {{tlc|Time ago|195909}} → '''{{Time ago|195909}}''' * ''Wrong:'' {{tlc|Time ago|196009}} → '''{{Time ago|196009}}''' == TemplateData == {{TemplateDataHeader}} <templatedata> { "description": "This template calculates the amount of time which has passed since a provided timestamp.", "params": { "1": { "label": "Timestamp", "description": "Base timestamp for calculation of passed time. Example format: Nov 6 2008, see template documentation for other supported formats.", "type": "string", "required": true }, "magnitude": { "label": "magnitude", "description": "Explicitly sets a specific unit to display return value. Allowed values are: seconds, minutes, hours, days, weeks, months and years.", "type": "string", "required": false }, "min_magnitude": { "label": "min_magnitude", "description": "Sets a minimum unit to display return value. Allowed values are: seconds, minutes, hours, days, months and years.", "type": "string", "required": false }, "ago": { "label": "ago", "description": "Override the default usage of the text 'ago'. If it is blank but not missing then 'ago' will be removed completely; for future dates, this will remove the text 'time' as well.", "type": "string", "required": false }, "purge": { "label": "Purge link", "description": "Add the parameter purge=yes to add a WP:PURGE link.", "type": "string", "required": false }, "spellout": { "type": "string/line", "label": "Spell out numbers", "description": "If set to \"yes\", \"y\", \"true\" or \"1\", numbers from 1 to 100 are spelled out as English words. If set to \"auto\", numbers from 1 to 9 are spelled out." }, "spelloutmax": { "type": "number", "label": "Spell out max", "description": "The maximum number to be spelled out as an English word." } } } </templatedata> == See also == * {{الگو|Last edited by}} * {{الگو|Years or months ago}} * {{الگو|Age}} * {{الگو|Start date and age}} * {{الگو|Birth date and age}} <includeonly>{{Sandbox other|| <!-- Categories go here and interwikis go in Wikidata --> [[رده:الگو:عملکردهای ریاضی تاریخ و زمان]] [[رده:الگو:محاسبهگر تاریخ بر مبنای زمان کنونی]] }}</includeonly>
خلاصه:
لطفاً توجه داشته باشید که همهٔ مشارکتها در ایرانپدیا ممکن است توسط دیگر مشارکتکنندگان تغییر یابند، ویرایش یا حذف شوند. اگر نمیخواهید نوشتههایتان بیرحمانه ویرایش شوند؛ بنابراین، آنها را اینجا ارائه نکنید.
شما همچنین به ما تعهد میکنید که خودتان این را نوشتهاید یا آن را از یک منبع با مالکیت عمومی یا مشابه آزاد آن برداشتهاید (
ایرانپدیا:حق تکثیر
را برای جزئیات بیشتر ببینید).
کارهای دارای حق تکثیر را بدون اجازه ارائه نکنید!
لغو
راهنمای ویرایش
(در پنجرهٔ تازه باز میشود)
پیشنمایش صفحه با این الگو
الگوهای بهکاررفته در این صفحه:
الگو:Documentation subpage
(
ویرایش
)
الگو:Formatnumber
(
ویرایش
)
الگو:High-use
(
ویرایش
)
الگو:Lua
(
ویرایش
)
الگو:Mbox
(
ویرایش
)
الگو:Namespace detect
(
ویرایش
)
الگو:Ombox
(
ویرایش
)
الگو:Ombox/styles.css
(
ویرایش
)
الگو:OrderMag
(
ویرایش
)
الگو:Order of magnitude
(
ویرایش
)
الگو:Order of magnitude/x
(
ویرایش
)
الگو:Para
(
ویرایش
)
الگو:Rnd
(
ویرایش
)
الگو:Rndnear
(
ویرایش
)
الگو:Sigfig
(
ویرایش
)
الگو:Significant figures/rnd
(
ویرایش
)
الگو:Str endswith
(
ویرایش
)
الگو:TemplateDataHeader
(
ویرایش
)
الگو:Time ago
(
ویرایش
)
الگو:Tlc
(
ویرایش
)
الگو:الگو
(
ویرایش
)
الگو:الگوک
(
ویرایش
)
الگو:زیرصفحه توضیحات
(
ویرایش
)
الگو:سرآیند الگوداده
(
ویرایش
)
الگو:لوآ
(
ویرایش
)
الگو:پارا
(
ویرایش
)
الگو:پراستفاده
(
ویرایش
)
الگو:پراستفاده/عدد
(
ویرایش
)
پودمان:Arguments
(
ویرایش
)
پودمان:List
(
ویرایش
)
پودمان:Lua banner
(
ویرایش
)
پودمان:Message box
(
ویرایش
)
پودمان:Message box/configuration
(
ویرایش
)
پودمان:Message box/ombox.css
(
ویرایش
)
پودمان:Namespace detect
(
ویرایش
)
پودمان:Namespace detect/config
(
ویرایش
)
پودمان:Namespace detect/data
(
ویرایش
)
پودمان:Numeral converter
(
ویرایش
)
پودمان:String
(
ویرایش
)
پودمان:TableTools
(
ویرایش
)
پودمان:Time ago
(
ویرایش
)
پودمان:Yesno
(
ویرایش
)
جستجو
جستجو
در حال ویرایش
الگو:Time ago/توضیحات
افزودن مبحث