Template:MONTHNUMBER/doc: Difference between revisions

From HIBIKIFORUM
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
{{template rating|p}}
__NOTOC__


This template returns the cyclic integer month number (between 1 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).
This template returns the cyclic integer month number (between 1 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).
Line 7: Line 7:


=== Syntax ===
=== Syntax ===
: <code><nowiki>{{</nowiki>MONTHNUMBER|</code>''month''<code>}}</code>
: {{tji|MONTHNUMBER|month}}
* The ''month'' value is interpreted modulo 12 (extra leading zeroes are ignored, negative numbers are accepted, all numbers are rounded to floor).
* 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 ===
=== Examples for all standard English month names ===
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|january}}</nowiki></code> returns {{MONTHNUMBER|january}}
: {{tlc|MONTHNUMBER|january}} {{Rarr}} {{MONTHNUMBER|january}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|february}}</nowiki></code> returns {{MONTHNUMBER|february}}
: {{tlc|MONTHNUMBER|february}} {{Rarr}} {{MONTHNUMBER|february}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|march}}</nowiki></code> returns {{MONTHNUMBER|march}}
: {{tlc|MONTHNUMBER|march}} {{Rarr}} {{MONTHNUMBER|march}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|april}}</nowiki></code> returns {{MONTHNUMBER|april}}
: {{tlc|MONTHNUMBER|april}} {{Rarr}} {{MONTHNUMBER|april}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|may}}</nowiki></code> returns {{MONTHNUMBER|may}}
: {{tlc|MONTHNUMBER|may}} {{Rarr}} {{MONTHNUMBER|may}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|june}}</nowiki></code> returns {{MONTHNUMBER|june}}
: {{tlc|MONTHNUMBER|june}} {{Rarr}} {{MONTHNUMBER|june}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|july}}</nowiki></code> returns {{MONTHNUMBER|july}}
: {{tlc|MONTHNUMBER|july}} {{Rarr}} {{MONTHNUMBER|july}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|august}}</nowiki></code> returns {{MONTHNUMBER|august}}
: {{tlc|MONTHNUMBER|august}} {{Rarr}} {{MONTHNUMBER|august}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|september}}</nowiki></code> returns {{MONTHNUMBER|september}}
: {{tlc|MONTHNUMBER|september}} {{Rarr}} {{MONTHNUMBER|september}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|october}}</nowiki></code> returns {{MONTHNUMBER|october}}
: {{tlc|MONTHNUMBER|october}} {{Rarr}} {{MONTHNUMBER|october}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|november}}</nowiki></code> returns {{MONTHNUMBER|november}}
: {{tlc|MONTHNUMBER|november}} {{Rarr}} {{MONTHNUMBER|november}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|december}}</nowiki></code> returns {{MONTHNUMBER|december}}
: {{tlc|MONTHNUMBER|december}} {{Rarr}} {{MONTHNUMBER|december}}


=== Examples for all abbreviated English month names ===
=== Examples for all abbreviated English month names ===
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|jan}}</nowiki></code> returns {{MONTHNUMBER|jan}}
: {{tlc|MONTHNUMBER|jan}} {{Rarr}} {{MONTHNUMBER|jan}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|feb}}</nowiki></code> returns {{MONTHNUMBER|feb}}
: {{tlc|MONTHNUMBER|feb}} {{Rarr}} {{MONTHNUMBER|feb}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|mar}}</nowiki></code> returns {{MONTHNUMBER|mar}}
: {{tlc|MONTHNUMBER|mar}} {{Rarr}} {{MONTHNUMBER|mar}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|apr}}</nowiki></code> returns {{MONTHNUMBER|apr}}
: {{tlc|MONTHNUMBER|apr}} {{Rarr}} {{MONTHNUMBER|apr}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|may}}</nowiki></code> returns {{MONTHNUMBER|may}}
: {{tlc|MONTHNUMBER|may}} {{Rarr}} {{MONTHNUMBER|may}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|jun}}</nowiki></code> returns {{MONTHNUMBER|jun}}
: {{tlc|MONTHNUMBER|jun}} {{Rarr}} {{MONTHNUMBER|jun}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|jul}}</nowiki></code> returns {{MONTHNUMBER|jul}}
: {{tlc|MONTHNUMBER|jul}} {{Rarr}} {{MONTHNUMBER|jul}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|aug}}</nowiki></code> returns {{MONTHNUMBER|aug}}
: {{tlc|MONTHNUMBER|aug}} {{Rarr}} {{MONTHNUMBER|aug}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|sep}}</nowiki></code> returns {{MONTHNUMBER|sep}}
: {{tlc|MONTHNUMBER|sep}} {{Rarr}} {{MONTHNUMBER|sep}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|oct}}</nowiki></code> returns {{MONTHNUMBER|oct}}
: {{tlc|MONTHNUMBER|oct}} {{Rarr}} {{MONTHNUMBER|oct}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|nov}}</nowiki></code> returns {{MONTHNUMBER|nov}}
: {{tlc|MONTHNUMBER|nov}} {{Rarr}} {{MONTHNUMBER|nov}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|dec}}</nowiki></code> returns {{MONTHNUMBER|dec}}
: {{tlc|MONTHNUMBER|dec}} {{Rarr}} {{MONTHNUMBER|dec}}


=== Examples for all standard month numbers ===
=== Examples for all standard month numbers ===
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|1}}</nowiki></code> returns {{MONTHNUMBER|1}}
: {{tlc|MONTHNUMBER|1}} {{Rarr}} {{MONTHNUMBER|1}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|2}}</nowiki></code> returns {{MONTHNUMBER|2}}
: {{tlc|MONTHNUMBER|2}} {{Rarr}} {{MONTHNUMBER|2}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|3}}</nowiki></code> returns {{MONTHNUMBER|3}}
: {{tlc|MONTHNUMBER|3}} {{Rarr}} {{MONTHNUMBER|3}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|4}}</nowiki></code> returns {{MONTHNUMBER|4}}
: {{tlc|MONTHNUMBER|4}} {{Rarr}} {{MONTHNUMBER|4}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|5}}</nowiki></code> returns {{MONTHNUMBER|5}}
: {{tlc|MONTHNUMBER|5}} {{Rarr}} {{MONTHNUMBER|5}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|6}}</nowiki></code> returns {{MONTHNUMBER|6}}
: {{tlc|MONTHNUMBER|6}} {{Rarr}} {{MONTHNUMBER|6}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|7}}</nowiki></code> returns {{MONTHNUMBER|7}}
: {{tlc|MONTHNUMBER|7}} {{Rarr}} {{MONTHNUMBER|7}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|8}}</nowiki></code> returns {{MONTHNUMBER|8}}
: {{tlc|MONTHNUMBER|8}} {{Rarr}} {{MONTHNUMBER|8}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|9}}</nowiki></code> returns {{MONTHNUMBER|9}}
: {{tlc|MONTHNUMBER|9}} {{Rarr}} {{MONTHNUMBER|9}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|10}}</nowiki></code> returns {{MONTHNUMBER|10}}
: {{tlc|MONTHNUMBER|10}} {{Rarr}} {{MONTHNUMBER|10}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|11}}</nowiki></code> returns {{MONTHNUMBER|11}}
: {{tlc|MONTHNUMBER|11}} {{Rarr}} {{MONTHNUMBER|11}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|12}}</nowiki></code> returns {{MONTHNUMBER|12}}
: {{tlc|MONTHNUMBER|12}} {{Rarr}} {{MONTHNUMBER|12}}


=== Examples for month numbers with extra leading zero ===
=== Examples for month numbers with extra leading zero ===
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|01}}</nowiki></code> returns {{MONTHNUMBER|01}}
: {{tlc|MONTHNUMBER|01}} {{Rarr}} {{MONTHNUMBER|01}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|02}}</nowiki></code> returns {{MONTHNUMBER|02}}
: {{tlc|MONTHNUMBER|02}} {{Rarr}} {{MONTHNUMBER|02}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|03}}</nowiki></code> returns {{MONTHNUMBER|03}}
: {{tlc|MONTHNUMBER|03}} {{Rarr}} {{MONTHNUMBER|03}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|04}}</nowiki></code> returns {{MONTHNUMBER|04}}
: {{tlc|MONTHNUMBER|04}} {{Rarr}} {{MONTHNUMBER|04}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|05}}</nowiki></code> returns {{MONTHNUMBER|05}}
: {{tlc|MONTHNUMBER|05}} {{Rarr}} {{MONTHNUMBER|05}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|06}}</nowiki></code> returns {{MONTHNUMBER|06}}
: {{tlc|MONTHNUMBER|06}} {{Rarr}} {{MONTHNUMBER|06}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|07}}</nowiki></code> returns {{MONTHNUMBER|07}}
: {{tlc|MONTHNUMBER|07}} {{Rarr}} {{MONTHNUMBER|07}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|08}}</nowiki></code> returns {{MONTHNUMBER|08}}
: {{tlc|MONTHNUMBER|08}} {{Rarr}} {{MONTHNUMBER|08}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|09}}</nowiki></code> returns {{MONTHNUMBER|09}}
: {{tlc|MONTHNUMBER|09}} {{Rarr}} {{MONTHNUMBER|09}}


=== Examples for month number underflows and overflows, from computed values ===
=== Examples for month number underflows and overflows, from computed values ===
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-1200}}</nowiki></code> returns {{MONTHNUMBER|-1200}}
: {{tlc|MONTHNUMBER|-1200}} {{Rarr}} {{MONTHNUMBER|-1200}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-1201}}</nowiki></code> returns {{MONTHNUMBER|-1201}}
: {{tlc|MONTHNUMBER|-1201}} {{Rarr}} {{MONTHNUMBER|-1201}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-1212}}</nowiki></code> returns {{MONTHNUMBER|-1212}}
: {{tlc|MONTHNUMBER|-1212}} {{Rarr}} {{MONTHNUMBER|-1212}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-12}}</nowiki></code> returns {{MONTHNUMBER|-12}}
: {{tlc|MONTHNUMBER|-12}} {{Rarr}} {{MONTHNUMBER|-12}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-11}}</nowiki></code> returns {{MONTHNUMBER|-11}}
: {{tlc|MONTHNUMBER|-11}} {{Rarr}} {{MONTHNUMBER|-11}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-10}}</nowiki></code> returns {{MONTHNUMBER|-10}}
: {{tlc|MONTHNUMBER|-10}} {{Rarr}} {{MONTHNUMBER|-10}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-9}}</nowiki></code> returns {{MONTHNUMBER|-9}}
: {{tlc|MONTHNUMBER|-9}} {{Rarr}} {{MONTHNUMBER|-9}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-8}}</nowiki></code> returns {{MONTHNUMBER|-8}}
: {{tlc|MONTHNUMBER|-8}} {{Rarr}} {{MONTHNUMBER|-8}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-7}}</nowiki></code> returns {{MONTHNUMBER|-7}}
: {{tlc|MONTHNUMBER|-7}} {{Rarr}} {{MONTHNUMBER|-7}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-6}}</nowiki></code> returns {{MONTHNUMBER|-6}}
: {{tlc|MONTHNUMBER|-6}} {{Rarr}} {{MONTHNUMBER|-6}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-5}}</nowiki></code> returns {{MONTHNUMBER|-5}}
: {{tlc|MONTHNUMBER|-5}} {{Rarr}} {{MONTHNUMBER|-5}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-4}}</nowiki></code> returns {{MONTHNUMBER|-4}}
: {{tlc|MONTHNUMBER|-4}} {{Rarr}} {{MONTHNUMBER|-4}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-3}}</nowiki></code> returns {{MONTHNUMBER|-3}}
: {{tlc|MONTHNUMBER|-3}} {{Rarr}} {{MONTHNUMBER|-3}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-2}}</nowiki></code> returns {{MONTHNUMBER|-2}}
: {{tlc|MONTHNUMBER|-2}} {{Rarr}} {{MONTHNUMBER|-2}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-1}}</nowiki></code> returns {{MONTHNUMBER|-1}}
: {{tlc|MONTHNUMBER|-1}} {{Rarr}} {{MONTHNUMBER|-1}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-0.9999}}</nowiki></code> returns {{MONTHNUMBER|-0.9999}}
: {{tlc|MONTHNUMBER|-0.9999}} {{Rarr}} {{MONTHNUMBER|-0.9999}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-0.5}}</nowiki></code> returns {{MONTHNUMBER|-0.5}}
: {{tlc|MONTHNUMBER|-0.5}} {{Rarr}} {{MONTHNUMBER|-0.5}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|-0.0001}}</nowiki></code> returns {{MONTHNUMBER|-0.0001}}
: {{tlc|MONTHNUMBER|-0.0001}} {{Rarr}} {{MONTHNUMBER|-0.0001}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|0}}</nowiki></code> returns {{MONTHNUMBER|0}}
: {{tlc|MONTHNUMBER|0}} {{Rarr}} {{MONTHNUMBER|0}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|0.0001}}</nowiki></code> returns {{MONTHNUMBER|0.0001}}
: {{tlc|MONTHNUMBER|0.0001}} {{Rarr}} {{MONTHNUMBER|0.0001}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|0.5}}</nowiki></code> returns {{MONTHNUMBER|0}}
: {{tlc|MONTHNUMBER|0.5}} {{Rarr}} {{MONTHNUMBER|0}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|0.9999}}</nowiki></code> returns {{MONTHNUMBER|0.9999}}
: {{tlc|MONTHNUMBER|0.9999}} {{Rarr}} {{MONTHNUMBER|0.9999}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|12.0001}}</nowiki></code> returns {{MONTHNUMBER|12.0001}}
: {{tlc|MONTHNUMBER|12.0001}} {{Rarr}} {{MONTHNUMBER|12.0001}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|12.5}}</nowiki></code> returns {{MONTHNUMBER|12.5}}
: {{tlc|MONTHNUMBER|12.5}} {{Rarr}} {{MONTHNUMBER|12.5}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|12.9999}}</nowiki></code> returns {{MONTHNUMBER|12.9999}}
: {{tlc|MONTHNUMBER|12.9999}} {{Rarr}} {{MONTHNUMBER|12.9999}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|13}}</nowiki></code> returns {{MONTHNUMBER|13}}
: {{tlc|MONTHNUMBER|13}} {{Rarr}} {{MONTHNUMBER|13}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|14}}</nowiki></code> returns {{MONTHNUMBER|14}}
: {{tlc|MONTHNUMBER|14}} {{Rarr}} {{MONTHNUMBER|14}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|24}}</nowiki></code> returns {{MONTHNUMBER|24}}
: {{tlc|MONTHNUMBER|24}} {{Rarr}} {{MONTHNUMBER|24}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|1200}}</nowiki></code> returns {{MONTHNUMBER|1200}}
: {{tlc|MONTHNUMBER|1200}} {{Rarr}} {{MONTHNUMBER|1200}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|1201}}</nowiki></code> returns {{MONTHNUMBER|1201}}
: {{tlc|MONTHNUMBER|1201}} {{Rarr}} {{MONTHNUMBER|1201}}
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|1212}}</nowiki></code> returns {{MONTHNUMBER|1212}}
: {{tlc|MONTHNUMBER|1212}} {{Rarr}} {{MONTHNUMBER|1212}}


=== Example for invalid month name ===
=== Example for invalid month name ===
: <code><nowiki>{{</nowiki>MONTHNUMBER<nowiki>|xx}}</nowiki></code> returns {{MONTHNUMBER|xx}}
: {{tlc|MONTHNUMBER|xx}} {{Rarr}} {{MONTHNUMBER|xx}}
 
== TemplateData ==
<templatedata>
{
"description": "Returns the cyclic integer month number (between 1 and 12) of the month whose real number is in parameter.",
"params": {
"1": {
"label": "Month Number",
"description": "The number to input for a month.",
"type": "number",
"suggestedvalues": [ "1", "Jan", "January" ],
"required": true
}
}
}
</templatedata>
 
 
<includeonly>{{sandbox other||{{testcases other||


<includeonly>
<!-- Categories below this line, please -->
<!-- Categories below this line, please -->
[[Category:Templates]]
[[Category:Utility templates]]
</includeonly>
}}}}</includeonly>

Latest revision as of 02:06, 20 August 2023

Light bulb.png }}
It contains usage information, categories and other content that is not part of the original template page.


This template returns the cyclic integer month number (between 1 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).

Does not play nicely with "subst:"

Syntax

{{MONTHNUMBER|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

{{MONTHNUMBER|january}} → 1
{{MONTHNUMBER|february}} → 2
{{MONTHNUMBER|march}} → 3
{{MONTHNUMBER|april}} → 4
{{MONTHNUMBER|may}} → 5
{{MONTHNUMBER|june}} → 6
{{MONTHNUMBER|july}} → 7
{{MONTHNUMBER|august}} → 8
{{MONTHNUMBER|september}} → 9
{{MONTHNUMBER|october}} → 10
{{MONTHNUMBER|november}} → 11
{{MONTHNUMBER|december}} → 12

Examples for all abbreviated English month names

{{MONTHNUMBER|jan}} → 1
{{MONTHNUMBER|feb}} → 2
{{MONTHNUMBER|mar}} → 3
{{MONTHNUMBER|apr}} → 4
{{MONTHNUMBER|may}} → 5
{{MONTHNUMBER|jun}} → 6
{{MONTHNUMBER|jul}} → 7
{{MONTHNUMBER|aug}} → 8
{{MONTHNUMBER|sep}} → 9
{{MONTHNUMBER|oct}} → 10
{{MONTHNUMBER|nov}} → 11
{{MONTHNUMBER|dec}} → 12

Examples for all standard month numbers

{{MONTHNUMBER|1}} → 1
{{MONTHNUMBER|2}} → 2
{{MONTHNUMBER|3}} → 3
{{MONTHNUMBER|4}} → 4
{{MONTHNUMBER|5}} → 5
{{MONTHNUMBER|6}} → 6
{{MONTHNUMBER|7}} → 7
{{MONTHNUMBER|8}} → 8
{{MONTHNUMBER|9}} → 9
{{MONTHNUMBER|10}} → 10
{{MONTHNUMBER|11}} → 11
{{MONTHNUMBER|12}} → 12

Examples for month numbers with extra leading zero

{{MONTHNUMBER|01}} → 1
{{MONTHNUMBER|02}} → 2
{{MONTHNUMBER|03}} → 3
{{MONTHNUMBER|04}} → 4
{{MONTHNUMBER|05}} → 5
{{MONTHNUMBER|06}} → 6
{{MONTHNUMBER|07}} → 7
{{MONTHNUMBER|08}} → 8
{{MONTHNUMBER|09}} → 9

Examples for month number underflows and overflows, from computed values

{{MONTHNUMBER|-1200}} → 12
{{MONTHNUMBER|-1201}} → 11
{{MONTHNUMBER|-1212}} → 12
{{MONTHNUMBER|-12}} → 12
{{MONTHNUMBER|-11}} → 1
{{MONTHNUMBER|-10}} → 2
{{MONTHNUMBER|-9}} → 3
{{MONTHNUMBER|-8}} → 4
{{MONTHNUMBER|-7}} → 5
{{MONTHNUMBER|-6}} → 6
{{MONTHNUMBER|-5}} → 7
{{MONTHNUMBER|-4}} → 8
{{MONTHNUMBER|-3}} → 9
{{MONTHNUMBER|-2}} → 10
{{MONTHNUMBER|-1}} → 11
{{MONTHNUMBER|-0.9999}} → 11
{{MONTHNUMBER|-0.5}} → 11
{{MONTHNUMBER|-0.0001}} → 11
{{MONTHNUMBER|0}} → 12
{{MONTHNUMBER|0.0001}} → 12
{{MONTHNUMBER|0.5}} → 12
{{MONTHNUMBER|0.9999}} → 12
{{MONTHNUMBER|12.0001}} → 12
{{MONTHNUMBER|12.5}} → 12
{{MONTHNUMBER|12.9999}} → 12
{{MONTHNUMBER|13}} → 1
{{MONTHNUMBER|14}} → 2
{{MONTHNUMBER|24}} → 12
{{MONTHNUMBER|1200}} → 12
{{MONTHNUMBER|1201}} → 1
{{MONTHNUMBER|1212}} → 12

Example for invalid month name

{{MONTHNUMBER|xx}}Expression error: Unrecognized word "xx".

TemplateData

Returns the cyclic integer month number (between 1 and 12) of the month whose real number is in parameter.

Template parameters

ParameterDescriptionTypeStatus
Month Number1

The number to input for a month.

Suggested values
1 Jan January
Numberrequired