Jump to content

ବ୍ୟବହାରକାରୀ:Jayantanth/ParserFunctions

ଉଇକିପିଡ଼ିଆ‌ରୁ
ଛାଞ୍ଚ:Hl1 | Code ଛାଞ୍ଚ:Hl1 | Description ଛାଞ୍ଚ:Hl1 | Current output
ଛାଞ୍ଚ:Hl2 colspan="3"| Year
Y 4-digit year. ୨୦୨୪
xNY 4-digit year. 2024
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

ଛାଞ୍ଚ:Hl2 colspan="3"| 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. ନଭେମ୍ବର
ଛାଞ୍ଚ:Hl2 colspan="3"| Week
W ISO 8601 week number, zero-padded. ୪୫
ଛାଞ୍ଚ:Hl2 colspan="3"| Day
j Day of the month, not zero-padded.
d Day of the month, zero-padded. ୦୮
z Day of the year (January 1 = 0) ୩୧୨
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.
w number of the day of the week (Monday = 1).
ଛାଞ୍ଚ:Hl2 colspan="3"| Hour
a "am" during the morning (00:00:00 → 11:59:59), "pm" otherwise (12:00:00 → 23:59:59) am
A Uppercase version of a above. AM
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. ୧୦
ଛାଞ୍ଚ:Hl2 colspan="3"| 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. ୧୭୩୧୦୬୩୦୪୨
ଛାଞ୍ଚ:Hl2 colspan="3"| Miscellaneous
L 1 if this year is a leap year in the Gregorian calendar, 0 otherwise
t Number of days in the current month. ୩୦
c ISO 8601 formatted date, equivalent to Y-m-dTH:i:s+00:00. 2024-11-08T10:50:42+00:00
r RFC 2822 formatted date, equivalent to D, j M Y H:i:s +0000, with weekday name and month name not internationalised. Fri, 08 Nov 2024 10:50:42 +0000
ଛାଞ୍ଚ:Hl2 colspan="3" | Non-Gregorian calendars
ଛାଞ୍ଚ:Hl3 colspan="3" | Iranian
xij Day of the month ୧୮
xiF Full month name Aban
xin Month index
xiY Full year ୧୪୦୩
ଛାଞ୍ଚ:Hl3 colspan="3" | Hebrew
xjj Day of the month
xjF Full month name Cheshvan
xjx Genitive form of the month name Cheshvan
xjn Month number
xjY Full year ୫୭୮୫
ଛାଞ୍ଚ:Hl3 colspan="3" | Thai solar
xkY Full year ୨୫୬୭
ଛାଞ୍ଚ:Hl2 colspan="3" | 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
xg Before a month flag (n, m, M, F), output the genitive form if the site language distinguishes between genitive and nominative forms.

This parser function takes a date and/or time construct 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. 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)]] }}୨୦୨୪ (୨୪UTCamFri, 08 Nov 2024 10:50:42 +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.

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 }}୨୦୨୪

A four-digit number is interpreted as hours and minutes if possible, and otherwise as year:
{{#time: Y m d H:i:s | 1959 }}୧୯୫୯ ୧୧ ୦୮ ୦୦:୦୦:୦୦ Input is treated as a time rather than a year.
{{#time: Y m d H:i:s | 1960 }}୧୯୬୦ ୧୧ ୦୮ ୦୦:୦୦:୦୦ Since 19:60 is not a valid time, 1960 is treated as a year.

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 }}୦୧ ମାର୍ଚ୍ଚ


  • {{CURRENTWEEK}}=୪୫
  • {{CURRENTDAY}}=୮
  • {{CURRENTDAYNAME}}=ଶୁକ୍ରବାର
  • {{#time:xN Y-m-d }}= 2024-11-08
  • {{#time:xN Y-F-d }}= 2024-ନଭେମ୍ବର-08
  • {{#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}}=1731063042
  • {{#time:nU}}=୧୧୧୭୩୧୦୬୩୦୪୨


  • {{#time:Y}}=୨୦୨୪
  • {{#time:xNY}}=2024
  • {{#time:F}}=ନଭେମ୍ବର
  • {{#time:xNF}}=ନଭେମ୍ବର


  • {{#time: F j}}=ନଭେମ୍ବର ୮
  • {{#time:xN F j}}= ନଭେମ୍ବର 8
  • {{#time:xN F j |{{{Day|1}}} {{{Month|January}}} {{CURRENTYEAR}} }}=ଅସୁବିଧା: ଅବୈଧ ସମୟ ।
  • {{{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}}=08
  • {{#time:xND}}=ଶୁକ୍ର
  • {{CURRENTDAY}}=୮
  • {{#time:F}}=ନଭେମ୍ବର
  • {{#time:xgF}}=ନଭେମ୍ବରନଭେମ୍ବର
  • {{CURRENTMONTH}}=୧୧
  • {{#time: xN m }}= 11


  • {{#time: xnY}} instead of {{CURRENTYEAR}}=2024 instead of ୨୦୨୪
  • {{subst:#time:xN Y-m-dl}}= 2010-03-15সোমবার
  • {{#time:xN Y-m-d}}= 2024-11-08
  • {{#time: xN m }}= 11

ଛାଞ୍ଚ:SelAnnivFooter


ଛାଞ୍ଚ:SelAnnivFooter