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

ଉଇକିପିଡ଼ିଆ‌ରୁ

#time[ସମ୍ପାଦନା]

ଛାଞ୍ଚ: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) 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. ୧୨
ଛାଞ୍ଚ: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-03-28T12:59:11+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. Thu, 28 Mar 2024 12:59:11 +0000
ଛାଞ୍ଚ:Hl2 colspan="3" | Non-Gregorian calendars
ଛାଞ୍ଚ:Hl3 colspan="3" | Iranian
xij Day of the month
xiF Full month name Farvardin
xin Month index
xiY Full year ୧୪୦୩
ଛାଞ୍ଚ:Hl3 colspan="3" | Hebrew
xjj Day of the month ୧୮
xjF Full month name Adar II
xjx Genitive form of the month name Adar II
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)]] }}୨୦୨୪ (୨୪UTCpmThu, 28 Mar 2024 12:59:11 +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 }}୦୧ ମାର୍ଚ୍ଚ


test[ସମ୍ପାଦନା]

  • {{CURRENTWEEK}}=୧୩
  • {{CURRENTDAY}}=୨୮
  • {{CURRENTDAYNAME}}=ଗୁରୁବାର
  • {{#time:xN Y-m-d }}= 2024-03-28
  • {{#time:xN Y-F-d }}= 2024-ମାର୍ଚ୍ଚ-28
  • {{#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}}=1711630751
  • {{#time:nU}}=୩୧୭୧୧୬୩୦୭୫୧


  • {{#time:Y}}=୨୦୨୪
  • {{#time:xNY}}=2024
  • {{#time:F}}=ମାର୍ଚ୍ଚ
  • {{#time:xNF}}=ମାର୍ଚ୍ଚ


  • {{#time: F j}}=ମାର୍ଚ୍ଚ ୨୮
  • {{#time:xN F j}}= ମାର୍ଚ୍ଚ 28
  • {{#time:xN F j |{{{Day|1}}} {{{Month|January}}} {{CURRENTYEAR}} }}=ଅସୁବିଧା: ଅବୈଧ ସମୟ ।

Problems[ସମ୍ପାଦନା]

  • {{{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}}=28
  • {{#time:xND}}=ଗୁରୁ
  • {{CURRENTDAY}}=୨୮
  • {{#time:F}}=ମାର୍ଚ୍ଚ
  • {{#time:xgF}}=ମାର୍ଚ୍ଚମାର୍ଚ୍ଚ
  • {{CURRENTMONTH}}=୦୩
  • {{#time: xN m }}= 03


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

ଛାଞ୍ଚ:SelAnnivFooter


ଛାଞ୍ଚ:SelAnnivFooter