Magic words

Magic words are strings of text that MediaWiki associates with a return value or function, such as time, site details, or page names. This page is about usage of standard magic words; for a technical reference, see

.

There are three general types of magic words:

  • Behavior switches: these are uppercase words surrounded by double underscores, e.g. __FOO__
  • Variables: these are uppercase words surrounded by double braces, e.g. {{FOO}}. As such, they look a lot like templates.
  • Parser functions: these take parameters and are either of the form {{foo:...}} or {{#foo:...}}. See also

.

Page-dependent magic words will affect or return data about the current page (by default), even if the word is added through a transcluded template or included system message.

Behavior switches

A behavior switch controls the layout or behavior of the page and can often be used to specify desired omissions and inclusions in the content.

Word Description Versions
Table of contents
__NOTOC__ Hides the table of contents (TOC).
__FORCETOC__ Forces the table of contents to appear at its normal position (above the first header).
__TOC__ Places a table of contents at the word's current position (overriding __NOTOC__). If this is used multiple times, the table of contents will appear at the first word's position.
Editing
__NOEDITSECTION__ Hides the section edit links beside headings. This is especially useful, where a heading is created from within a template: the normal wiki section-edit would in this case edit the template code, which is normally counterintuitive to the user. If a template contains multiple headings, it may be necessary to add "" after each heading.
__NEWSECTIONLINK__ Adds a link ("+" by default) beside the "edit" tab for adding a new section on a non-talk page (see ). 1.7+
__NONEWSECTIONLINK__ Removes the link beside the "edit" tab on pages in talk namespaces.
Categories
__NOGALLERY__ Used on a category page, replaces thumbnails in the category view with normal links. 1.7+
__HIDDENCAT__ Used on a category page, hides the category from the lists of categories in its members and parent categories (there is an option in the user preferences to show them). 1.13+
Language conversion
__NOCONTENTCONVERT__
__NOCC__
On wikis with language variants, don't perform any content language conversion (character and phase) in article display; for example, only show Chinese (zh) instead of variants like zh_cn, zh_tw, zh_sg, or zh_hk.
__NOTITLECONVERT__
__NOTC__
On wikis with language variants, don't perform language conversion on the title (all other content is converted).
Other
__START__ No effect.
__END__ Explicitly marks the end of the article, to prevent MediaWiki from removing trailing whitespace. Removed in . 1.1–1.8
__INDEX__ Tell search engines to index the page (overrides , but not robots.txt). 1.14+
__NOINDEX__ Tell search engines not to index the page (ie, do not list in search engines' results).
__STATICREDIRECT__ On redirect pages, don't allow MediaWiki to automatically update the link when someone moves a page and checks "Update any redirects that point to the original title".

Variables

Variables return information about the current page, wiki, or date. Their syntax is similar to templates. Variables marked as "[expensive]" are tracked by the software, and the number that can be included on a page is limited.

If a template name conflicts with a variable, the variable will be used (so to transclude the template টেমপ্লেট:PAGENAME you would need to write {{টেমপ্লেট:PAGENAME}}). In some cases, adding parameters will force the parser to invoke a template; for example, {{CURRENTDAYNAME|x}} transcludes টেমপ্লেট:CURRENTDAYNAME, not the variable.

Date and time

The following variables return the current date and time in UTC.

Due to MediaWiki and browser caching, these variables frequently show when the page was cached rather than the current time.

The date and time magic words are formatted in the wiki content language. Since উদ্ধৃতি ত্রুটি: <ref> ট্যাগ বৈধ নয়; নাম কোন সরল পূর্ণসংখ্যা হতে পারবে না। একটি বিবরণমূলক শিরোনাম ব্যবহার করুন[১], they depend on the page content language.

Variable Output Description Versions
Year
{{CURRENTYEAR}} ২০২৪ Year
Month
{{CURRENTMONTH}} ০৪ Month (zero-padded number)
{{CURRENTMONTHNAME}} এপ্রিল Month (name)
{{CURRENTMONTHNAMEGEN}} এপ্রিল Month (genitive form)
{{CURRENTMONTHABBREV}} এপ্রিল Month (abbreviation) 1.5+
Day
{{CURRENTDAY}} ১৯ Day of the month (unpadded number)
{{CURRENTDAY2}} ১৯ Day of the month (zero-padded number) 1.6+
{{CURRENTDOW}} Day of the week (unpadded number), 0 (for Sunday) through 6 (for Saturday)
{{CURRENTDAYNAME}} শুক্রবার Day of the week (name)
Time
{{CURRENTTIME}} ২০:২৪ Time (24-hour HH:mm format)
{{CURRENTHOUR}} ২০ Hour (24-hour zero-padded number)
Other
{{CURRENTWEEK}} ১৬ Week (number)
{{CURRENTTIMESTAMP}} 20240419202440 YYYYMMDDHHmmss timestamp 1.7+

The following variables do the same as the above, but using the site's server config or $wgLocaltimezone.

  • {{LOCALYEAR}}
  • {{LOCALMONTH}}
  • {{LOCALMONTHNAME}}
  • {{LOCALMONTHNAMEGEN}}
  • {{LOCALMONTHABBREV}}
  • {{LOCALDAY}}
  • {{LOCALDAY2}}
  • {{LOCALDOW}}
  • {{LOCALDAYNAME}}
  • {{LOCALTIME}}
  • {{LOCALHOUR}}
  • {{LOCALWEEK}}
  • {{LOCALTIMESTAMP}}
For more thorough time formatting, you may want to install Extension:ParserFunctions to use the #time parser function

Technical metadata

Note: Revision variables return data about the latest edit to the current page, even if viewing an older version of the page.

Variable Output Description Versions
Site
{{SITENAME}} উইকিপিডিয়া The wiki's site name ().
{{SERVER}} //bn.wikipedia.org domain URL ()
{{SERVERNAME}} bn.wikipedia.org domain name (No longer dependent on as of version 1.17)
{{DIRMARK}}
{{DIRECTIONMARK}}

Outputs a unicode-directional mark that matches the wiki's default language's direction (&lrm; on left-to-right wikis, &rlm; on right-to-left wikis), useful in text with multi-directional text. Since উদ্ধৃতি ত্রুটি: <ref> ট্যাগ বৈধ নয়; নাম কোন সরল পূর্ণসংখ্যা হতে পারবে না। একটি বিবরণমূলক শিরোনাম ব্যবহার করুন[১], it depends on the page content language. উদ্ধৃতি ত্রুটি: <ref> ট্যাগ বৈধ নয়; নাম কোন সরল পূর্ণসংখ্যা হতে পারবে না। একটি বিবরণমূলক শিরোনাম ব্যবহার করুন[২]
{{SCRIPTPATH}} /w relative script path ()
{{STYLEPATH}} /w/skins relative style path () 1.16+
{{CURRENTVERSION}} 1.43.0-wmf.1 (8e1947e) The wiki's MediaWiki version. উদ্ধৃতি ত্রুটি: <ref> ট্যাগ বৈধ নয়; নাম কোন সরল পূর্ণসংখ্যা হতে পারবে না। একটি বিবরণমূলক শিরোনাম ব্যবহার করুন[২]
{{CONTENTLANGUAGE}}
{{CONTENTLANG}}
bn
bn
The wiki's default interface language () উদ্ধৃতি ত্রুটি: <ref> ট্যাগ বৈধ নয়; নাম কোন সরল পূর্ণসংখ্যা হতে পারবে না। একটি বিবরণমূলক শিরোনাম ব্যবহার করুন[২]
Latest revision to current page
{{REVISIONID}} - Unique revision ID 1.5+
{{REVISIONDAY}} 26 Day edit was made (unpadded number) 1.8+
{{REVISIONDAY2}} 26 Day edit was made (zero-padded number) 1.8+
{{REVISIONMONTH}} 04 Month edit was made (zero-padded number as of , unpadded number in prior versions) 1.8+
{{REVISIONMONTH1}} 4 Month edit was made (unpadded number)
{{REVISIONYEAR}} 2012 Year edit was made 1.8+
{{REVISIONTIMESTAMP}} 20120426165346 Timestamp as of time of edit 1.8+
{{REVISIONUSER}} Jayantanth The username of the user who made the most recent edit to the page, or the current user when previewing an edit
{{PAGESIZE:page name}}
{{PAGESIZE:page name|R}}
৮৯
89
[expensive] Returns the byte size of the specified page. Use "|R" to get raw numbers.
{{PROTECTIONLEVEL:action}} Outputs the protection level (e.g. 'autoconfirmed', 'sysop') for a given action (e.g. 'edit', 'move') on the current page or an empty string if not protected.
Affects page content
{{DISPLAYTITLE:title}} Format the current page's title header. The value must be equivalent to the default title: only capitalization changes and replacing spaces with underscores are allowed (this can be changed with টেমপ্লেট:Manual). It can be disabled or enabled by ; disabled by default before 1.10+, enabled by default thereafter. 1.7+
{{DEFAULTSORT:sortkey}}
{{DEFAULTSORTKEY:sortkey}}
{{DEFAULTCATEGORYSORT:sortkey}}
{{DEFAULTSORT:sortkey|noerror}}
{{DEFAULTSORT:sortkey|noreplace}}
Used for categorizing pages, sets a default category sort key. For example if you put {{DEFAULTSORT:Smith, John}} at the end of John Smith, the page would be sorted under "S" by default in categories. It can take a second argument of noerror or noreplace to suppress error messages when multiple defaultsortkey's are used on one page or to make it do nothing if multiple defaultsortkey's are used. 1.10+
(for noerror and noreplace)

Statistics

Numbers returned by these variables normally contain separators (commas or spaces, depending on the local language), but can return raw numbers with the ":R" flag (for example, {{NUMBEROFPAGES}} → ১২,৩৭,৬৪৬ and {{NUMBEROFPAGES:R}} → 1237646). Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example {{PAGESINCATEGORY:Help}} and {{PAGESINCATEGORY:Help|R}}). Also applicable to {{PAGESIZE:page name}} above.

The number magic words are formatted in the wiki content language. Since উদ্ধৃতি ত্রুটি: <ref> ট্যাগ বৈধ নয়; নাম কোন সরল পূর্ণসংখ্যা হতে পারবে না। একটি বিবরণমূলক শিরোনাম ব্যবহার করুন[১], it depends on the page content language.

Variable Output Description Versions
Entire wiki
{{NUMBEROFPAGES}} ১২,৩৭,৬৪৬ Number of wiki pages. 1.7+
{{NUMBEROFARTICLES}} ১,৫১,৫৫৭ Number of pages in .
{{NUMBEROFFILES}} ১৮,৩০০ Number of uploaded files. 1.5+
{{NUMBEROFEDITS}} ৭৩,২৮,৫১১ Number of page edits.
{{NUMBEROFVIEWS}} টেমপ্লেট:NUMBEROFVIEWS Number of page views. Usually useless on a wiki using caching.
{{NUMBEROFUSERS}} ৪,৫৩,৮২৫ Number of registered users. 1.7+
{{NUMBEROFADMINS}} ১৪ Number of users in the sysop . 1.7+
{{NUMBEROFACTIVEUSERS}} ৯৩৮ Number of active users, based on the criteria used in Special:Statistics.
{{PAGESINCATEGORY:categoryname}}
{{PAGESINCAT:Help}}

[expensive] Number of pages in the given category.
{{NUMBERINGROUP:groupname}}
{{NUMINGROUP:groupname}}


({{NUMBERINGROUP:bureaucrat}} used here)
Number of users in a specific .
{{PAGESINNS:index}}
{{PAGESINNAMESPACE:index}}
not enabled Number of pages in the given namespace (replace index with the relevant namespace index). For instance, {{PAGESINNAMESPACE:14}} will output the number of category pages. {{PAGESINNS:0}} differs from {{NUMBEROFARTICLES}} in that the former includes redirects and disambiguation pages. Disabled by default, enable with . 1.7+

Page names

Variable Output Description Versions
{{FULLPAGENAME}} ব্যবহারকারী:Jayantanth/ParserFunctions Namespace and page title. 1.6+
{{PAGENAME}} Jayantanth/ParserFunctions Page title.
{{BASEPAGENAME}} Jayantanth Page title excluding the current subpage and namespace ("Title/foo" on "Title/foo/bar").

For more complex splitting, use {{#titleparts:}} from ParserFunctions extension.

1.7+
{{SUBPAGENAME}} ParserFunctions The subpage title ("foo" on "Title/foo"). 1.6+
{{SUBJECTPAGENAME}}
{{ARTICLEPAGENAME}}
ব্যবহারকারী:Jayantanth/ParserFunctions
ব্যবহারকারী:Jayantanth/ParserFunctions
The namespace and title of the associated subject page. 1.7+
{{TALKPAGENAME}} ব্যবহারকারী আলাপ:Jayantanth/ParserFunctions The namespace and title of the associated talk page. 1.7+

The {{BASEPAGENAME}} and {{SUBPAGENAME}} magic words only work in namespaces that have subpages enabled. See

for information on enabling subpages.

URL encoded page names

The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters HTML escaped using numeric character encoding):

  • {{FULLPAGENAMEE}}
  • {{PAGENAMEE}}
  • {{BASEPAGENAMEE}}
  • {{SUBPAGENAMEE}}
  • {{SUBJECTPAGENAMEE}}
  • {{ARTICLEPAGENAMEE}}
  • {{TALKPAGENAMEE}}

For example, if page name is "L'Aquila", the following code will produce the string "Numeric char encoding":

{{#switch:{{PAGENAME}}
|L'Aquila = No translation
|L = not ok
|L&apos;Aquila = Entity Escaping
|L&#39;Aquila = Numeric char encoding
}}

(See this bug for more information.)

As of

, these can all take a parameter, allowing specification of the page to be operated on, instead of just the current page:

  • {{PAGENAME:Template:Main Page}}Main Page

Note that {{PAGENAME}}, {{PAGENAMEE}} and {{urlencode:}} have distinct implementations. See Manual:PAGENAMEE encoding for details.

Namespaces

Variable Output Description Versions
{{NAMESPACE}} ব্যবহারকারী Name of the page's namespace
{{NAMESPACENUMBER}} 2 ID of the page's namespace 1.20+
{{SUBJECTSPACE}}
{{ARTICLESPACE}}
ব্যবহারকারী
ব্যবহারকারী
Name of the associated content namespace 1.7+
{{TALKSPACE}} ব্যবহারকারী আলাপ Name of the associated talk namespace 1.7+

The following are equivalents encoded for use in MediaWiki URLs (spaces replaced with underscores and some characters percent-encoded):

  • {{NAMESPACEE}}
  • {{SUBJECTSPACEE}}
  • {{TALKSPACEE}}

As of

, these can take a full-page-name parameter and will return the requested namespace associated with that page, instead of with the current page:

  • {{NAMESPACE:Template:Main Page}}টেমপ্লেট
  • {{SUBJECTSPACE:Template:Main Page}}টেমপ্লেট
  • {{TALKSPACE:Template:Main Page}}টেমপ্লেট আলোচনা

Parameter must not be a namespace name:

  • {{SUBJECTSPACE:Help talk}} → '

Parser functions

Parser functions are very similar to variables, but take one or more parameters (technically, any magic word that takes a parameter is a parser function), and the name is sometimes prefixed with a hash to distinguish them from templates.

This page only describes parser functions that are integral to the MediaWiki software. Other parser functions may be added by MediaWiki extensions such as the

. For those see Help:Extension:ParserFunctions.

URL data

Parser function Input → Output Description Versions
{{localurl:page name}}
{{localurl:page name|query_string}}
{{localurl:MediaWiki}} → /wiki/MediaWiki
{{localurl:MediaWiki|printable=yes}} → /w/index.php?title=MediaWiki&printable=yes
The relative path to the title.
{{fullurl:page name}}
{{fullurl:page name|query_string}}
{{fullurl:interwiki:remote page name|query_string}}
{{fullurl:Category:Top level}} → //bn.wikipedia.org/wiki/%E0%A6%AC%E0%A6%BF%E0%A6%B7%E0%A6%AF%E0%A6%BC%E0%A6%B6%E0%A7%8D%E0%A6%B0%E0%A7%87%E0%A6%A3%E0%A7%80:Top_level

{{fullurl:Category:Top level|action=edit}} → //bn.wikipedia.org/w/index.php?title=%E0%A6%AC%E0%A6%BF%E0%A6%B7%E0%A6%AF%E0%A6%BC%E0%A6%B6%E0%A7%8D%E0%A6%B0%E0%A7%87%E0%A6%A3%E0%A7%80:Top_level&action=edit

A protocol-relative path to the title. This will also resolve Interwiki prefixes. Note: Unbracketed (plain) protocol-relative links are not automagically linked. 1.5+
{{canonicalurl:page name}}
{{canonicalurl:page name|query_string}}
{{canonicalurl:interwiki:remote page name|query_string}}
{{canonicalurl:Category:Top level}}https://bn.wikipedia.org/wiki/%E0%A6%AC%E0%A6%BF%E0%A6%B7%E0%A6%AF%E0%A6%BC%E0%A6%B6%E0%A7%8D%E0%A6%B0%E0%A7%87%E0%A6%A3%E0%A7%80:Top_level

{{canonicalurl:Category:Top level|action=edit}}https://bn.wikipedia.org/w/index.php?title=%E0%A6%AC%E0%A6%BF%E0%A6%B7%E0%A6%AF%E0%A6%BC%E0%A6%B6%E0%A7%8D%E0%A6%B0%E0%A7%87%E0%A6%A3%E0%A7%80:Top_level&action=edit

The absolute path to the title, using the canonical url. This will also resolve Interwiki prefixes. 1.18+
{{filepath:file name}}
{{filepath:file name|nowiki}}
{{filepath:file name|thumbnail_size}}
{{filepath:Wiki.png}}

{{filepath:Wiki.png|nowiki}}
{{filepath:Example.svg|300}} → //upload.wikimedia.org/wikipedia/bn/thumb/a/af/%E0%A6%B6%E0%A7%81%E0%A6%A7%E0%A7%81%E0%A6%AE%E0%A6%BE%E0%A6%A4%E0%A7%8D%E0%A6%B0_%E0%A6%86%E0%A6%B0%E0%A7%87%E0%A6%95%E0%A6%9F%E0%A6%BF_%E0%A6%89%E0%A6%A6%E0%A6%BE%E0%A6%B9%E0%A6%B0%E0%A6%A3.svg/300px-%E0%A6%B6%E0%A7%81%E0%A6%A7%E0%A7%81%E0%A6%AE%E0%A6%BE%E0%A6%A4%E0%A7%8D%E0%A6%B0_%E0%A6%86%E0%A6%B0%E0%A7%87%E0%A6%95%E0%A6%9F%E0%A6%BF_%E0%A6%89%E0%A6%A6%E0%A6%BE%E0%A6%B9%E0%A6%B0%E0%A6%A3.svg.png

The absolute URL to the full size or thumbnail () of a media file.
{{urlencode:string}} (or {{urlencode:string|QUERY}})
{{urlencode:string|WIKI}}
{{urlencode:string|PATH}}
{{urlencode:x y z á é}} (or {{urlencode:x y z á é|QUERY}}) → x+y+z+%C3%A1+%C3%A9
{{urlencode:x y z á é|WIKI}} → x_y_z_%C3%A1_%C3%A9
{{urlencode:x y z á é|PATH}} → x%20y%20z%20%C3%A1%20%C3%A9

Note that the default changed from |WIKI to |QUERY in 1.17; this may break templates that rely on this function.

The input encoded for use in URLs. Note that there is no urldecode function like there is in the obsolete Extension:StringFunctions. (or )

{{anchorencode:string}} {{anchorencode:x y z á é}} → x_y_z_á_é The input encoded for use in URL section anchors (after the '#' symbol in a URL).

Namespaces

{{ns:}} returns the current localized name for the namespace with that index, canonical name, or local alias. Thus {{ns:6}}, {{ns:File}}, and {{ns:Image}} (an old name for the File namespace) all return "চিত্র". On a wiki where the content language was French, {{ns:Fichier}} would also be valid, but {{ns:Datei}} (the localisation of "File" into German) would not.

{{nse:}} is the equivalent encoded for MediaWiki URLs. It does the same, but it replaces spaces with underscores, making it usable in external links.

Content namespaces Talk namespaces
Usage Output Usage Output
{{ns:-2}} or {{ns:Media}} মিডিয়া
{{ns:-1}} or {{ns:Special}} বিশেষ
{{ns:0}} or {{ns:}} {{ns:1}} or {{ns:Talk}} আলাপ
{{ns:2}} or {{ns:User}} ব্যবহারকারী {{ns:3}} or {{ns:User talk}} ব্যবহারকারী আলাপ
{{ns:4}} or {{ns:Project}} উইকিপিডিয়া {{ns:5}} or {{ns:Project talk}} উইকিপিডিয়া আলোচনা
{{ns:6}} or {{ns:File}} or {{ns:Image}} চিত্র {{ns:7}} or {{ns:File talk}} or {{ns:Image talk}} চিত্র আলোচনা
{{ns:8}} or {{ns:MediaWiki}} মিডিয়াউইকি {{ns:9}} or {{ns:MediaWiki talk}} মিডিয়াউইকি আলোচনা
{{ns:10}} or {{ns:Template}} টেমপ্লেট {{ns:11}} or {{ns:Template talk}} টেমপ্লেট আলোচনা
{{ns:12}} or {{ns:Help}} সাহায্য {{ns:13}} or {{ns:Help talk}} সাহায্য আলোচনা
{{ns:14}} or {{ns:Category}} বিষয়শ্রেণী {{ns:15}} or {{ns:Category talk}} বিষয়শ্রেণী আলোচনা

Formatting

Usage Input → Output Description Version
{{formatnum:unformatted num}}
{{formatnum:formatted num|R}}
{{formatnum:987654321.654321}}
→ ৯৮,৭৬,৫৪,৩২১.৬৫৪৩২১

{{formatnum:987,654,321.654321|R}}
→ 987654321.654321
{{formatnum:{{formatnum:987.654.321}}}}
→ 987 654 321 (e.g. with Italian locale)
{{formatnum:00001}}
→ ০০,০০১

The input with decimal and decimal group separators, and localized digit script, according to the wiki's default locale. The |R parameter can be used to unformat a number, for use in mathematical situations. It doesn't always work if you try to unformat a number in non-English format on a wiki with non-English locale; if you need to format (according the wiki's locale) a number in unknown input format, try and use formatnum two times (but not if it can have a decimal group, or its separator will be eaten or the number won't be formatted).
Leading zeroes are not removed, you can use {{#expr:00001}} instead if you have Extension:ParserFunctions installed
1.7+

{{#dateformat:date}} {{#formatdate:date}} {{#dateformat:date|format}} {{#formatdate:date|format}}

{{#dateformat:25 deC 2009|ymd}}
→ 25 deC 2009 (your pref), 2009 DeC 25 (default)
{{#formatdate:dec 25,2009|dmy}}
→ dec 25,2009 (your pref), 25 Dec 2009 (default)
{{#dateformat:2009-12-25|mdy}}
ডিসেম্বর 25, 2009 (your pref), December 25, 2009 (default)
{{#formatdate:2009 dec 25|ISO 8601}}
→ 2009 dec 25 (your pref), 2009-12-25 (default)
{{#dateformat:25 decEmber|mdy}}
→ 25 decEmber (your pref), DecEmber 25 (default)


Note: In the example above, "your pref" refers to your date preference on the current MediaWiki wiki only.

Formats an unlinked date based on user "Date format" preference, and adds metadata tagging it as a formatted date. For logged-out users and those who have not set a date format in their preferences, dates can be given a default: mdy, dmy, ymd, ISO 8601 (all case sensitive). If only the month and day are given, only mdy and dmy are valid. If a format is not specified or is invalid, the input format is used as a default. If the supplied date is not recognized as a valid date (specifically, if it contains any metadata such as from a nested use of these or similar templates), it is rendered unchanged, and no (additional) metadata is generated.
Although the ISO 8601 standard requires that dates be in the Gregorian calendar, the ISO parameter in this function will still format dates that fall outside the usual Gregorian range (e.g. dates prior to 1583). Also, the magic word cannot properly convert between negative years (used with ISO 8601) and years BC or years BCE (used in general writing).
{{lc:string}} {{lc:DATA CENTER}} → data center The lowercase input. 1.5+
{{lcfirst:string}} {{lcfirst:DATA center}} → dATA center The input with the very first character lowercase. 1.5+
{{uc:string}} {{uc:text transform}} → TEXT TRANSFORM The uppercase input. 1.5+
{{ucfirst:string}} {{ucfirst:text TRANSFORM}} → Text TRANSFORM The input with the very first character uppercase. 1.5+
{{padleft:xyz|stringlength}}
{{padleft:xyz|strlen|char}}
{{padleft:xyz|strlen|string}}
{{padleft:xyz|5}} → 00xyz
{{padleft:xyz|5|_}} → __xyz {{padleft:xyz|5|abc}} → abxyz {{padleft:xyz|2}} → xyz
{{padleft:|1|xyz}} → x (first character of the string)
Inserts a string of padding characters (character chosen in third parameter; default '0') of a specified length (second parameter) next to a chosen base character or variable (first parameter). The final digits or characters in the base replace the final characters in the padding; i.e. {{padleft:44|3|0}} produces 044. The padding string may be truncated if its length does not evenly divide the required number of characters.
(fixed in ): multibyte characters are interpreted as two characters, which can skew width. These also cannot be used as padding characters.
1.8+
{{padright:xyz|stringlength}}
{{padright:xyz|strlen|char}}
{{padright:xyz|strlen|string}}
{{padright:xyz|5}} → xyz00

{{padright:xyz|5|_}} → xyz__ {{padright:xyz|5|abc}} → xyzab {{padright:xyz|2}} → xyz
{{padright:|1|xyz}} → x

Identical to padleft, but adds padding characters to the right side.

See also: Extension:StringFunctions

Localisation

Here are the magic words which are used as main localisation tools. Other magic words will often depend on the wiki's locale and configuration or on the chosen language: see in particular #Date and time, #Formatting, #Miscellaneous.

The usage of these magic words can be very complex, and the documentation is currently incomplete; there's some more info on Plural, Grammar, Gender.

Usage Input → Output Description Version
{{plural:2|is|are}} {{plural:0|is|are}} → is
{{plural:1*1|is|are}} → is
{{plural:21 mod 10|is|are}} → are
{{plural:{{#expr:21 mod 10}}|is|are}} → is
{{plural:1|is|are}} → is
{{plural:2|is|are}} → are
(for Polish):
{{plural:2|milion|miliony|milionów}} → miliony
Outputs the singular form (second parameter) if the first parameter is an expression equalling one; the plural form (third parameter) otherwise. Its functioning is language-dependent. Plural transformations are used for languages like Russian based on "count mod 10". You should not expect this to handle fractions (like 44.5) — see bug 28128.
{{grammar:N|noun}} Outputs the correct inflected form of the given word described by the inflection code after the colon (language-dependent). Grammar transformations are used for inflected languages like Polish. See also . 1.7+
{{gender:username
|return text if user is male
|return text if user is female
|return text if user hasn't defined their gender}}
(depends on the named user's gender) A switch for the gender set in Special:Preferences.

Note: If 3rd parameter is omitted and user hasn't defined his/her gender, then text if user is male is returned.

{{int:message name}} {{int:edit}}সম্পাদনা
(depends on user language, try: frja)
Internationalizes (translates) the given interface (MediaWiki namespace) message into the user language. Note that this can damage/confuse cache consistency in MediaWiki 1.17 and earlier, see bug 14404.
{{int:editsectionhint|MediaWiki}} {{int:editsectionhint|MediaWiki}}অনুচ্ছেদ সম্পাদনা: MediaWiki You may also use parameters with translations.
Parameters are designated in messages with: $1, $2, $3, etc.
For example, here is the message for editsectionhint: Edit section: $1
In this example, MediaWiki replaces $1.

Miscellaneous

[[Category:ব্যবহারকারী টেমপ্লেট {{{2}}}|]]

#time

Code Description Current output
(Purge this page's cache to update)
Year
Y 4-digit year. ২০২৪
y 2-digit year. ২৪
L 1 or 0 whether it's a leap year or not.
o ¹ ISO-8601 year number. ² ২০২৪ ³

¹ Requires PHP 5.1.0 and newer and rev:45208.
² This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.
³ Will output literal o if ¹ not fulfilled.

Month
n Month index, not zero-padded.
m Month index, zero-padded. ০৪
M An abbreviation of the month name, in the site language. এপ্রিল
F The full month name in the site language. এপ্রিল
xg Output the full month name in the genitive form for site languages that distinguish between genitive and nominative forms. For Polish:

(nominative)

{{#time:d F Y|20 June 2010}} → 20 czerwiec 2010

(genitive)

{{#time:d xg Y|20 June 2010}} → 20 czerwca 2010

Week
W ISO 8601 week number, zero-padded. ১৬
Day
j Day of the month, not zero-padded. ১৯
d Day of the month, zero-padded. ১৯
z Day of the year (January 1 = 0).
[[#ref_{{{1}}}|^]] To get the ISO day of the year add 1.
১০৯
D An abbreviation for the day of the week. Rarely internationalised. শুক্র
l The full weekday name. Rarely internationalised. শুক্রবার
N ISO 8601 day of the week (Monday = 1, Sunday = 7).
w Number of the day of the week (Sunday = 0, Saturday = 6).
Hour
a "am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59). pm
A Uppercase version of a above. PM
g Hour in 12-hour format, not zero-padded.
h Hour in 12-hour format, zero-padded. ০৮
G Hour in 24-hour format, not zero-padded. ২০
H Hour in 24-hour format, zero-padded. ২০
Minutes and seconds
i Minutes past the hour, zero-padded. ২৪
s Seconds past the minute, zero-padded. ৪০
U Seconds since January 1 1970 00:00:00 GMT. ১৭১৩৫৫৮২৮০
Miscellaneous
t Number of days in the current month. ৩০
c ISO 8601 formatted date, equivalent to Y-m-dTH:i:s+00:00. 2024-04-19T20:24:40+00:00
r RFC 5322 formatted date, equivalent to D, j M Y H:i:s +0000, with weekday name and month name not internationalised. Fri, 19 Apr 2024 20:24:40 +0000
Non-Gregorian calendars
Islamic
xmj Day of the month. ১০
xmF Full month name. শাওয়াল
xmn Month index. ১০
xmY Full year. ১৪৪৫
Iranian
xij Day of the month. ৩১
xiF Full month name. ফারওয়ারদিন
xin Month index.
xiY Full year. ১৪০৩
Hebrew
xjj Day of the month. ১১
xjF Full month name. নিসান
xjt Number of days in month. ৩০
xjx Genitive form of the month name. নিসান
xjn Month number.
xjY Full year. ৫৭৮৪
Thai solar
xkY Full year. ২৫৬৭
Minguo/Juche year
xoY Full year. ১১৩
Japanese nengo
xtY Full year. 令和6
Flags
xn Format the next numeric code as a raw ASCII number. In the Hindi language, {{#time:H, xnH}} produces ०६, 06.
xN Like xn, but as a toggled flag, which endures until the end of the string or until the next appearance of xN in the string.
xr Format the next number as a roman numeral. Only works for numbers up to 3000. {{#time:xrY}} → MMXXIV
xh Format the next number as a Hebrew numeral. {{#time:xhY}} → ב'כ"ד

This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the magic word {{CURRENTTIMESTAMP}} – that is, the time the page was last rendered into HTML.

{{#time: format string }}
{{#time: format string | date/time object }}

The list of accepted formatting codes is given in the table to the right. Any character in the formatting string that is not recognised is passed through unaltered; this applies also to blank spaces (the system does not need them for interpreting the codes). There are also two ways to escape characters within the formatting string:

  1. A backslash followed by a formatting character is interpreted as a single literal character
  2. Characters enclosed in double quotes are considered literal characters, and the quotes are removed.

In addition, the digraph xx is interpreted as a single literal "x".

{{#time: Y-m-d }}২০২৪-০৪-১৯
{{#time: [[Y]] m d }}২০২৪ ০৪ ১৯
{{#time: [[Y (year)]] }}২০২৪ (২৪UTCpmFri, 19 Apr 2024 20:24:40 +0000)
{{#time: [[Y "(year)"]] }}২০২৪ (year)
{{#time: i's" }}২৪'৪০"

The date/time object can be in any format accepted by PHP's strtotime() function. Both absolute (eg 20 December 2000) and relative (eg +20 hours) times are accepted.

{{#time: r|now}}Fri, 19 Apr 2024 20:24:41 +0000
{{#time: r|+2 hours}}Fri, 19 Apr 2024 22:24:41 +0000
{{#time: r|now + 2 hours}}Fri, 19 Apr 2024 22:24:41 +0000

If you've calculated a Unix timestamp, you may use it in date calculations by pre-pending an @ symbol.

{{#time: U | now }}১৭১৩৫৫৮২৮১
{{#time: r|@১৭১৩৫৫৮২৮০}}ত্রুটি: অবৈধ সময়

Full or partial absolute dates can be specified; the function will "fill in" parts of the date that are not specified using the current values:

{{#time: Y | January 1 }}২০২৪

With MediaWiki r86805 - Code Review, a four-digit number is always interpreted as a year, never as hours and minutes:
{{#time: Y m d H:i:s | 1959 }}১৯৫৯ ০৪ ১৯ ০০:০০:০০

A six-digit number is interpreted as hours, minutes and seconds if possible, but otherwise as an error (not, for instance, a year and month):
{{#time: Y m d H:i:s | 195909 }}২০২৪ ০৪ ১৯ ১৯:৫৯:০৯ Input is treated as a time rather than a year+month code.
{{#time: Y m d H:i:s | 196009 }}ত্রুটি: অবৈধ সময় Although 19:60:09 is not a valid time, 196009 is not interpreted as September 1960.

The function performs a certain amount of date mathematics:

{{#time: d F Y | January 0 2008 }}৩১ ডিসেম্বর ২০০৭
{{#time: d F | January 32 }}ত্রুটি: অবৈধ সময়
{{#time: d F | February 29 2008 }}২৯ ফেব্রুয়ারি
{{#time: d F | February 29 2007 }}০১ মার্চ
{{#time:Y-F|now -1 months}}২০২৪-মার্চ

The total length of the format strings of the calls of #time is limited to 6000 characters [১].


test

  • {{CURRENTWEEK}}=১৬
  • {{CURRENTDAY}}=১৯
  • {{CURRENTDAYNAME}}=শুক্রবার
  • {{#time:xN Y-m-d }}= 2024-04-19
  • {{#time:xN Y-F-d }}= 2024-এপ্রিল-19
  • {{#time:xN d F Y | January 0 2008 }} = 31 ডিসেম্বর 2007
  • {{ #expr: {{ #expr: ((({{#time:xNYmdHis}} / 1000000) round 0)) /10000 round 0}} - {{{year|2005}}} }}=19
  • {{#time:xnU}}=1713558280
  • {{#time:nU}}=৪১৭১৩৫৫৮২৮০


  • {{#time:Y}}=২০২৪
  • {{#time:xNY}}=2024
  • {{#time:F}}=এপ্রিল
  • {{#time:xNF}}=এপ্রিল


  • {{#time: F j}}=এপ্রিল ১৯
  • {{#time:xN F j}}= এপ্রিল 19
  • {{#time:xN F j |{{{Day|1}}} {{{Month|January}}} {{CURRENTYEAR}} }}=ত্রুটি: অবৈধ সময়


test2

  • {{CURRENTDAY}}-1=১৯-1
  • {{en2bndigit|{{#expr: {{#time:xnj}}-1}}}} = ১৮


  • {{REVISIONYEAR}} =2012

Problems

  • {{#time:Y F j|{{{1|{{CURRENTYEAR}}}}}-{{{2|{{CURRENTMONTH}}}}}-{{{3|{{CURRENTDAY}}}}} -2 days}}=ত্রুটি: অবৈধ সময়
  • {{#time:Y F j|{{{1|{{CURRENTYEAR}}}}}-{{{2|{{CURRENTMONTH}}}}}-{{{3|{{CURRENTDAY}}}}}}}=ত্রুটি: অবৈধ সময়


prob

  • {{#time:Y-F-j|{{Bn2endigits|{{{1|{{CURRENTYEAR}}}}}}}-{{Bn2endigits|{{{2|{{CURRENTMONTH}}}}}}}-{{Bn2endigits|{{{3|{{CURRENTDAY}}}}}}} -1days}}= ২০২৪-এপ্রিল-১৮
  • {{#time:Y-F-j|{{Bn2endigits|{{{1|{{CURRENTYEAR}}}}}}}-{{Bn2endigits|{{{2|{{CURRENTMONTH}}}}}}}-{{Bn2endigits|{{{3|{{CURRENTDAY}}}}}}}-2days}}= ২০২৪-এপ্রিল-১৭

mejor

  • {{#time:Y F j-1 days}}= ২০২৪ এপ্রিল ১৯-1 ১৯pm২৪৪০
  • {{#time:Y F j -1 }}= ২০২৪ এপ্রিল ১৯- 1
  • {{{year|{{CURRENTYEAR}}}}}=২০২৪
  • {{#time:xND|{{{year|{{CURRENTYEAR}}}}}0301}}=ত্রুটি: অবৈধ সময়
  • {{#time:D|{{{year|{{#time:xY}}}}}0301}}=শুক্র
  • {{#time:xND|{{{year|{{#time:xY}}}}}0301}}=শুক্র
  • {{#time:D}}=শুক্র
  • {{#time:d}}=১৯
  • {{#time:xNd}}=19
  • {{#time:xND}}=শুক্র
  • {{CURRENTDAY}}=১৯
  • {{#time:F}}=এপ্রিল
  • {{#time:xgF}}=এপ্রিলএপ্রিল
  • {{CURRENTMONTH}}=০৪
  • {{#time: xN m }}= 04


  • {{#time: xnY}} instead of {{CURRENTYEAR}}=2024 instead of ২০২৪
  • {{subst:#time:xN Y-m-dl}}= 2010-03-15সোমবার
  • {{#time:xN Y-m-d}}= 2024-04-19
  • {{#time: xN m }}= 04

টেমপ্লেট:SelAnnivFooter


টেমপ্লেট:SelAnnivFooter


Style

Text Any thing here


Text Any thing here


Text Any thing here


<script language="javascript" type="text/javascript" src="http://www.pallab.com/services/BanglaDateToday.js"></script>


<script language="javascript" type="text/javascript" src="http://www.pallab.com/services/BanglaDateTodayInEnglish.js"></script>


var today = new Date(); var dd = today.getDate(); var mm = today.getMonth() + 1; var yyyy = today.getFullYear(); var hh = today.getHours(); var min = today.getMinutes(); var eDate = mm + "/" + dd + "/" + yyyy + " " + hh + ":" + min; document.write('<script language="javascript" src="http://www.pallab.com/services/getbangladate.aspx?EDate=' + eDate + '"><\/script>');


এক্সক্সক্স

  • {{#time: M d| +6 Hours}} =এপ্রিল ২০
  • {{#time: M d| +6 Hours}} = এপ্রিল ২০
  1. উদ্ধৃতি ত্রুটি: <ref> ট্যাগ বৈধ নয়; 1.19 নামের সূত্রটির জন্য কোন লেখা প্রদান করা হয়নি
  2. উদ্ধৃতি ত্রুটি: <ref> ট্যাগ বৈধ নয়; 1.7+ নামের সূত্রটির জন্য কোন লেখা প্রদান করা হয়নি
  3. উদ্ধৃতি ত্রুটি: <ref> ট্যাগ বৈধ নয়; 1.18+ নামের সূত্রটির জন্য কোন লেখা প্রদান করা হয়নি