Template:MONTH: Difference between revisions
Content deleted Content added
mNo edit summary |
(No difference) |
Revision as of 21:22, 7 May 2006
Template documentation[view] [edit] [history] [purge]
This template returns the cyclic integer month number in ISO format (between 01 and 12) of the month whose real number is in parameter. Alternatively, the month can be given with its English name (complete or abbreviated to 3 characters, with capitals or small letters).
Syntax
{{MONTH|
month}}
- The month value is interpreted modulo 12 (extra leading zeroes are ignored, negative numbers are accepted, all numbers are rounded to floor).
Examples for all standard month numbers
{{MONTH|1}}
returns 01{{MONTH|2}}
returns 02{{MONTH|3}}
returns 03{{MONTH|4}}
returns 04{{MONTH|5}}
returns 05{{MONTH|6}}
returns 06{{MONTH|7}}
returns 07{{MONTH|8}}
returns 08{{MONTH|9}}
returns 09{{MONTH|10}}
returns 10{{MONTH|11}}
returns 11{{MONTH|12}}
returns 12
Examples for month numbers with extra leading zero
{{MONTH|01}}
returns 01{{MONTH|02}}
returns 02{{MONTH|03}}
returns 03{{MONTH|04}}
returns 04{{MONTH|05}}
returns 05{{MONTH|06}}
returns 06{{MONTH|07}}
returns 07{{MONTH|08}}
returns 08{{MONTH|09}}
returns 09
Examples for month number underflows and overflows, from computed values
{{MONTH|-1200}}
returns -1200{{MONTH|-1201}}
returns -1201{{MONTH|-1212}}
returns -1212{{MONTH|-12}}
returns -12{{MONTH|-11}}
returns 01{{MONTH|-10}}
returns 02{{MONTH|-9}}
returns 03{{MONTH|-8}}
returns 04{{MONTH|-7}}
returns 05{{MONTH|-6}}
returns 06{{MONTH|-5}}
returns 07{{MONTH|-4}}
returns 08{{MONTH|-3}}
returns 09{{MONTH|-2}}
returns -2{{MONTH|-1}}
returns -1{{MONTH|-0.9999}}
returns -0.9999{{MONTH|-0.5}}
returns -0.5{{MONTH|-0.0001}}
returns -0.0001{{MONTH|0}}
returns 0{{MONTH|0.0001}}
returns 0.0001{{MONTH|0.5}}
returns 0{{MONTH|0.9999}}
returns 0.9999{{MONTH|12.0001}}
returns 12.0001{{MONTH|12.5}}
returns 12.5{{MONTH|12.9999}}
returns 12.9999{{MONTH|13}}
returns 01{{MONTH|14}}
returns 02{{MONTH|24}}
returns 24{{MONTH|1200}}
returns 1200{{MONTH|1201}}
returns 01{{MONTH|1212}}
returns 1212
Example for invalid month name
{{MONTH|xxx}}
returns xxx
See also
Multiple units of time
Type | Adjustable | Current | Last | Next |
---|---|---|---|---|
Date and time | {{time}} | {{Currentdate}} (MDY) {{Plain now}} (DMY) {{Now}} (DMY in a complete sentence) {{Simple now}} |
||
Date only | {{Dateonly}} {{Datedow}} (Has the day of the week) |
{{Date}} (Chose format) {{DATE}} (prefixed by date=) {{TODAY}} (DMY) |
{{Yesterday}} {{Day-1}} |
{{Tomorrow}} {{Day+1}} |
Month and year only | {{Monthyear}} | {{Monthyear-1}} | {{Monthyear+1}} | |
Time only | {{Timeonly}} | {{CURRENTTIME}} (12 h format) {{CURRENTTIME24}} (24 h format) |
||
Banners | {{Right now}} (Blue with time and number of Wikipedia articles) |
|||
Timestamp | {{Timestamp}} (Format YYYYMMDDhhmmss) |
Single units of time
Unit of time | Adjustable | Current | Last | Next |
---|---|---|---|---|
Second | {{CURRENTSECOND}} | |||
Minute | {{CURRENTMINUTE}} | |||
Hour | {{CURRENTHOUR}} | |||
Week | {{CURRENTWEEK}} {{CURRENTWEEKOFMONTH}} |
|||
Day of Week | {{DAYOFWEEK}} | {{CURRENTDAYNAME}} {{CURRENTWEEKDAYABBREV}} {{CURRENTWEEKDAY}} |
||
Month | {{MONTHNAME}} {{MONTHABBREV}} {{MONTHNUMBER}} {{MONTH}} (zero padded) |
{{CURRENTMONTHNAME}} {{CURRENTMONTHABBREV}} {{CURRENTMONTH1}} {{CURRENTMONTHDAYS}} |
{{LASTMONTHNAME}} | {{NEXTMONTHNAME}} |
Day of Month | {{CURRENTDAY}} {{CURRENTDAY2}} (zero padded) |
|||
Year | {{CURRENTYEARCC}} {{CURRENTYEARYY}} {{CURRENTISOYEAR}} {{CURRENTYEAR}} |
{{LASTYEAR}} | {{NEXTYEAR}} | |
Day of Year | {{CURRENTDAYOFYEAR}} | |||
Decade | {{DECADE}} | {{CURRENTDECADE}} | ||
Century | {{Century}} | {{CURRENTCENTURY}} | ||
MILLENNIUM | {{MILLENNIUM}} |
Date and time templates made for substitution:
Month:
{{Lmonth}} produces Jan
{{Nmonth}} produces Mar
{{Last month}} produces January 2025
{{Next month}} produces March 2025
Individual templates
- {{Calendar}}
- {{Calendar clock with Wikipedia stats}}
- {{Clock}}
- {{Digital clock}}
- {{Digital clock and date}}
- {{Infobox calendar date today}}
Categories of templates
This template returns the cyclic integer month number in ISO format (between 01 and 12) of the month whose real number is in parameter. Alternatively, the month can be given with its english name (complete or abbreviated to 3 characters, with capitals or small letters).
- Syntax:
- {{MONTH|month}}
- The month value is interpreted modulo 12 (extra leading zeroes are ignored, negative numbers are accepted, all numbers are rounded to floor).
- Examples for all standard English month names:
- {{MONTH|january}} returns 01
- {{MONTH|february}} returns 02
- {{MONTH|march}} returns 03
- {{MONTH|april}} returns 04
- {{MONTH|may}} returns 05
- {{MONTH|june}} returns 06
- {{MONTH|july}} returns 07
- {{MONTH|august}} returns 08
- {{MONTH|september}} returns 09
- {{MONTH|october}} returns october
- {{MONTH|november}} returns november
- {{MONTH|december}} returns december
- Examples for all abbreviated English month names:
- {{MONTH|jan}} returns 01
- {{MONTH|feb}} returns 02
- {{MONTH|mar}} returns 03
- {{MONTH|apr}} returns 04
- {{MONTH|may}} returns 05
- {{MONTH|jun}} returns 06
- {{MONTH|jul}} returns 07
- {{MONTH|aug}} returns 08
- {{MONTH|sep}} returns 09
- {{MONTH|oct}} returns oct
- {{MONTH|nov}} returns nov
- {{MONTH|dec}} returns dec
- Examples for all standard month numbers:
- {{MONTH|1}} returns 01
- {{MONTH|2}} returns 02
- {{MONTH|3}} returns 03
- {{MONTH|4}} returns 04
- {{MONTH|5}} returns 05
- {{MONTH|6}} returns 06
- {{MONTH|7}} returns 07
- {{MONTH|8}} returns 08
- {{MONTH|9}} returns 09
- {{MONTH|10}} returns 10
- {{MONTH|11}} returns 11
- {{MONTH|12}} returns 12
- Examples for month numbers with extra leading zero:
- {{MONTH|01}} returns 01
- {{MONTH|02}} returns 02
- {{MONTH|03}} returns 03
- {{MONTH|04}} returns 04
- {{MONTH|05}} returns 05
- {{MONTH|06}} returns 06
- {{MONTH|07}} returns 07
- {{MONTH|08}} returns 08
- {{MONTH|09}} returns 09
- Examples for month number underflows and overflows, from computed values:
- {{MONTH|-1200}} returns -1200
- {{MONTH|-1201}} returns -1201
- {{MONTH|-1212}} returns -1212
- {{MONTH|-12}} returns -12
- {{MONTH|-11}} returns 01
- {{MONTH|-10}} returns 02
- {{MONTH|-9}} returns 03
- {{MONTH|-8}} returns 04
- {{MONTH|-7}} returns 05
- {{MONTH|-6}} returns 06
- {{MONTH|-5}} returns 07
- {{MONTH|-4}} returns 08
- {{MONTH|-3}} returns 09
- {{MONTH|-2}} returns -2
- {{MONTH|-1}} returns -1
- {{MONTH|-0.9999}} returns -0.9999
- {{MONTH|-0.5}} returns -0.5
- {{MONTH|-0.0001}} returns -0.0001
- {{MONTH|0}} returns 0
- {{MONTH|0.0001}} returns 0.0001
- {{MONTH|0.5}} returns 0
- {{MONTH|0.9999}} returns 0.9999
- {{MONTH|12.0001}} returns 12.0001
- {{MONTH|12.5}} returns 12.5
- {{MONTH|12.9999}} returns 12.9999
- {{MONTH|13}} returns 01
- {{MONTH|14}} returns 02
- {{MONTH|24}} returns 24
- {{MONTH|1200}} returns 1200
- {{MONTH|1201}} returns 01
- {{MONTH|1212}} returns 1212
- Example for invalid month name:
- {{MONTH|xxx}} returns xxx