Template:MONTHNUMBER
{{#ifeq:monthnumber |doc
|
{{#ifeq:show |show
|This is a documentation subpage for Template:MONTHNUMBER. It contains usage information, categories and other content that is not part of the original {{#if: |{{{text2}}} |{{#if: |{{{text1}}} |{{#ifeq:Template |User |template template page |{{#if:Template |template page|article}}}}}}}}. |
}}{{#if: | | {{#ifexist:Template:MONTHNUMBER | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]] | }} }} | }}
<templatestyles src="Template:Ombox/styles.css" />
This {{
|Module=Lua module
|#default=template
}} is used on {{#if:857,000+|857,000+|a very large number of}} pages.
|Module=module |#default=template }} should first be tested in its [[{{
| doc | sandbox = Template:MONTHNUMBER | #default = Template:MONTHNUMBER }}/sandbox|/sandbox]] or [[{{
| doc | sandbox = Template:MONTHNUMBER | #default = Template:MONTHNUMBER }}/testcases|/testcases]] subpages{{
|Module=. |#default= or in your own user subpage. }} The tested changes can then be added to this page in a single edit. Please consider discussing any changes {{#if:|at [[{{{2}}}]]|on the [[{{
| doc | sandbox = Template talk:MONTHNUMBER | #default = Template talk:MONTHNUMBER }}|talk page]]}} before implementing them. |
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[edit]
- {{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[edit]
- {{MONTHNUMBER|january}} returns {{#if:january
|{{#switch:january |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:january<0 |{{#ifexpr:((january)round 0)!=(january) |{{#expr:12-(((0.5-(january))round 0)mod 12)}} |{{#expr:12-(((11.5-(january))round 0)mod 12)}} }} |{{#expr:(((10.5+january)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|february}} returns {{#if:february
|{{#switch:february |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:february<0 |{{#ifexpr:((february)round 0)!=(february) |{{#expr:12-(((0.5-(february))round 0)mod 12)}} |{{#expr:12-(((11.5-(february))round 0)mod 12)}} }} |{{#expr:(((10.5+february)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|march}} returns {{#if:march
|{{#switch:march |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:march<0 |{{#ifexpr:((march)round 0)!=(march) |{{#expr:12-(((0.5-(march))round 0)mod 12)}} |{{#expr:12-(((11.5-(march))round 0)mod 12)}} }} |{{#expr:(((10.5+march)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|april}} returns {{#if:april
|{{#switch:april |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:april<0 |{{#ifexpr:((april)round 0)!=(april) |{{#expr:12-(((0.5-(april))round 0)mod 12)}} |{{#expr:12-(((11.5-(april))round 0)mod 12)}} }} |{{#expr:(((10.5+april)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|may}} returns {{#if:may
|{{#switch:may |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:may<0 |{{#ifexpr:((may)round 0)!=(may) |{{#expr:12-(((0.5-(may))round 0)mod 12)}} |{{#expr:12-(((11.5-(may))round 0)mod 12)}} }} |{{#expr:(((10.5+may)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|june}} returns {{#if:june
|{{#switch:june |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:june<0 |{{#ifexpr:((june)round 0)!=(june) |{{#expr:12-(((0.5-(june))round 0)mod 12)}} |{{#expr:12-(((11.5-(june))round 0)mod 12)}} }} |{{#expr:(((10.5+june)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|july}} returns {{#if:july
|{{#switch:july |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:july<0 |{{#ifexpr:((july)round 0)!=(july) |{{#expr:12-(((0.5-(july))round 0)mod 12)}} |{{#expr:12-(((11.5-(july))round 0)mod 12)}} }} |{{#expr:(((10.5+july)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|august}} returns {{#if:august
|{{#switch:august |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:august<0 |{{#ifexpr:((august)round 0)!=(august) |{{#expr:12-(((0.5-(august))round 0)mod 12)}} |{{#expr:12-(((11.5-(august))round 0)mod 12)}} }} |{{#expr:(((10.5+august)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|september}} returns {{#if:september
|{{#switch:september |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:september<0 |{{#ifexpr:((september)round 0)!=(september) |{{#expr:12-(((0.5-(september))round 0)mod 12)}} |{{#expr:12-(((11.5-(september))round 0)mod 12)}} }} |{{#expr:(((10.5+september)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|october}} returns {{#if:october
|{{#switch:october |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:october<0 |{{#ifexpr:((october)round 0)!=(october) |{{#expr:12-(((0.5-(october))round 0)mod 12)}} |{{#expr:12-(((11.5-(october))round 0)mod 12)}} }} |{{#expr:(((10.5+october)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|november}} returns {{#if:november
|{{#switch:november |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:november<0 |{{#ifexpr:((november)round 0)!=(november) |{{#expr:12-(((0.5-(november))round 0)mod 12)}} |{{#expr:12-(((11.5-(november))round 0)mod 12)}} }} |{{#expr:(((10.5+november)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|december}} returns {{#if:december
|{{#switch:december |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:december<0 |{{#ifexpr:((december)round 0)!=(december) |{{#expr:12-(((0.5-(december))round 0)mod 12)}} |{{#expr:12-(((11.5-(december))round 0)mod 12)}} }} |{{#expr:(((10.5+december)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
Examples for all abbreviated English month names[edit]
- {{MONTHNUMBER|jan}} returns {{#if:jan
|{{#switch:jan |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:jan<0 |{{#ifexpr:((jan)round 0)!=(jan) |{{#expr:12-(((0.5-(jan))round 0)mod 12)}} |{{#expr:12-(((11.5-(jan))round 0)mod 12)}} }} |{{#expr:(((10.5+jan)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|feb}} returns {{#if:feb
|{{#switch:feb |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:feb<0 |{{#ifexpr:((feb)round 0)!=(feb) |{{#expr:12-(((0.5-(feb))round 0)mod 12)}} |{{#expr:12-(((11.5-(feb))round 0)mod 12)}} }} |{{#expr:(((10.5+feb)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|mar}} returns {{#if:mar
|{{#switch:mar |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:mar<0 |{{#ifexpr:((mar)round 0)!=(mar) |{{#expr:12-(((0.5-(mar))round 0)mod 12)}} |{{#expr:12-(((11.5-(mar))round 0)mod 12)}} }} |{{#expr:(((10.5+mar)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|apr}} returns {{#if:apr
|{{#switch:apr |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:apr<0 |{{#ifexpr:((apr)round 0)!=(apr) |{{#expr:12-(((0.5-(apr))round 0)mod 12)}} |{{#expr:12-(((11.5-(apr))round 0)mod 12)}} }} |{{#expr:(((10.5+apr)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|may}} returns {{#if:may
|{{#switch:may |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:may<0 |{{#ifexpr:((may)round 0)!=(may) |{{#expr:12-(((0.5-(may))round 0)mod 12)}} |{{#expr:12-(((11.5-(may))round 0)mod 12)}} }} |{{#expr:(((10.5+may)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|jun}} returns {{#if:jun
|{{#switch:jun |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:jun<0 |{{#ifexpr:((jun)round 0)!=(jun) |{{#expr:12-(((0.5-(jun))round 0)mod 12)}} |{{#expr:12-(((11.5-(jun))round 0)mod 12)}} }} |{{#expr:(((10.5+jun)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|jul}} returns {{#if:jul
|{{#switch:jul |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:jul<0 |{{#ifexpr:((jul)round 0)!=(jul) |{{#expr:12-(((0.5-(jul))round 0)mod 12)}} |{{#expr:12-(((11.5-(jul))round 0)mod 12)}} }} |{{#expr:(((10.5+jul)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|aug}} returns {{#if:aug
|{{#switch:aug |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:aug<0 |{{#ifexpr:((aug)round 0)!=(aug) |{{#expr:12-(((0.5-(aug))round 0)mod 12)}} |{{#expr:12-(((11.5-(aug))round 0)mod 12)}} }} |{{#expr:(((10.5+aug)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|sep}} returns {{#if:sep
|{{#switch:sep |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:sep<0 |{{#ifexpr:((sep)round 0)!=(sep) |{{#expr:12-(((0.5-(sep))round 0)mod 12)}} |{{#expr:12-(((11.5-(sep))round 0)mod 12)}} }} |{{#expr:(((10.5+sep)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|oct}} returns {{#if:oct
|{{#switch:oct |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:oct<0 |{{#ifexpr:((oct)round 0)!=(oct) |{{#expr:12-(((0.5-(oct))round 0)mod 12)}} |{{#expr:12-(((11.5-(oct))round 0)mod 12)}} }} |{{#expr:(((10.5+oct)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|nov}} returns {{#if:nov
|{{#switch:nov |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:nov<0 |{{#ifexpr:((nov)round 0)!=(nov) |{{#expr:12-(((0.5-(nov))round 0)mod 12)}} |{{#expr:12-(((11.5-(nov))round 0)mod 12)}} }} |{{#expr:(((10.5+nov)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|dec}} returns {{#if:dec
|{{#switch:dec |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:dec<0 |{{#ifexpr:((dec)round 0)!=(dec) |{{#expr:12-(((0.5-(dec))round 0)mod 12)}} |{{#expr:12-(((11.5-(dec))round 0)mod 12)}} }} |{{#expr:(((10.5+dec)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
Examples for all standard month numbers[edit]
- {{MONTHNUMBER|1}} returns {{#if:1
|{{#switch:1 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:1<0 |{{#ifexpr:((1)round 0)!=(1) |{{#expr:12-(((0.5-(1))round 0)mod 12)}} |{{#expr:12-(((11.5-(1))round 0)mod 12)}} }} |{{#expr:(((10.5+1)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|2}} returns {{#if:2
|{{#switch:2 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:2<0 |{{#ifexpr:((2)round 0)!=(2) |{{#expr:12-(((0.5-(2))round 0)mod 12)}} |{{#expr:12-(((11.5-(2))round 0)mod 12)}} }} |{{#expr:(((10.5+2)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|3}} returns {{#if:3
|{{#switch:3 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:3<0 |{{#ifexpr:((3)round 0)!=(3) |{{#expr:12-(((0.5-(3))round 0)mod 12)}} |{{#expr:12-(((11.5-(3))round 0)mod 12)}} }} |{{#expr:(((10.5+3)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|4}} returns {{#if:4
|{{#switch:4 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:4<0 |{{#ifexpr:((4)round 0)!=(4) |{{#expr:12-(((0.5-(4))round 0)mod 12)}} |{{#expr:12-(((11.5-(4))round 0)mod 12)}} }} |{{#expr:(((10.5+4)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|5}} returns {{#if:5
|{{#switch:5 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:5<0 |{{#ifexpr:((5)round 0)!=(5) |{{#expr:12-(((0.5-(5))round 0)mod 12)}} |{{#expr:12-(((11.5-(5))round 0)mod 12)}} }} |{{#expr:(((10.5+5)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|6}} returns {{#if:6
|{{#switch:6 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:6<0 |{{#ifexpr:((6)round 0)!=(6) |{{#expr:12-(((0.5-(6))round 0)mod 12)}} |{{#expr:12-(((11.5-(6))round 0)mod 12)}} }} |{{#expr:(((10.5+6)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|7}} returns {{#if:7
|{{#switch:7 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:7<0 |{{#ifexpr:((7)round 0)!=(7) |{{#expr:12-(((0.5-(7))round 0)mod 12)}} |{{#expr:12-(((11.5-(7))round 0)mod 12)}} }} |{{#expr:(((10.5+7)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|8}} returns {{#if:8
|{{#switch:8 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:8<0 |{{#ifexpr:((8)round 0)!=(8) |{{#expr:12-(((0.5-(8))round 0)mod 12)}} |{{#expr:12-(((11.5-(8))round 0)mod 12)}} }} |{{#expr:(((10.5+8)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|9}} returns {{#if:9
|{{#switch:9 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:9<0 |{{#ifexpr:((9)round 0)!=(9) |{{#expr:12-(((0.5-(9))round 0)mod 12)}} |{{#expr:12-(((11.5-(9))round 0)mod 12)}} }} |{{#expr:(((10.5+9)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|10}} returns {{#if:10
|{{#switch:10 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:10<0 |{{#ifexpr:((10)round 0)!=(10) |{{#expr:12-(((0.5-(10))round 0)mod 12)}} |{{#expr:12-(((11.5-(10))round 0)mod 12)}} }} |{{#expr:(((10.5+10)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|11}} returns {{#if:11
|{{#switch:11 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:11<0 |{{#ifexpr:((11)round 0)!=(11) |{{#expr:12-(((0.5-(11))round 0)mod 12)}} |{{#expr:12-(((11.5-(11))round 0)mod 12)}} }} |{{#expr:(((10.5+11)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|12}} returns {{#if:12
|{{#switch:12 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:12<0 |{{#ifexpr:((12)round 0)!=(12) |{{#expr:12-(((0.5-(12))round 0)mod 12)}} |{{#expr:12-(((11.5-(12))round 0)mod 12)}} }} |{{#expr:(((10.5+12)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
Examples for month numbers with extra leading zero[edit]
- {{MONTHNUMBER|01}} returns {{#if:01
|{{#switch:01 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:01<0 |{{#ifexpr:((01)round 0)!=(01) |{{#expr:12-(((0.5-(01))round 0)mod 12)}} |{{#expr:12-(((11.5-(01))round 0)mod 12)}} }} |{{#expr:(((10.5+01)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|02}} returns {{#if:02
|{{#switch:02 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:02<0 |{{#ifexpr:((02)round 0)!=(02) |{{#expr:12-(((0.5-(02))round 0)mod 12)}} |{{#expr:12-(((11.5-(02))round 0)mod 12)}} }} |{{#expr:(((10.5+02)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|03}} returns {{#if:03
|{{#switch:03 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:03<0 |{{#ifexpr:((03)round 0)!=(03) |{{#expr:12-(((0.5-(03))round 0)mod 12)}} |{{#expr:12-(((11.5-(03))round 0)mod 12)}} }} |{{#expr:(((10.5+03)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|04}} returns {{#if:04
|{{#switch:04 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:04<0 |{{#ifexpr:((04)round 0)!=(04) |{{#expr:12-(((0.5-(04))round 0)mod 12)}} |{{#expr:12-(((11.5-(04))round 0)mod 12)}} }} |{{#expr:(((10.5+04)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|05}} returns {{#if:05
|{{#switch:05 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:05<0 |{{#ifexpr:((05)round 0)!=(05) |{{#expr:12-(((0.5-(05))round 0)mod 12)}} |{{#expr:12-(((11.5-(05))round 0)mod 12)}} }} |{{#expr:(((10.5+05)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|06}} returns {{#if:06
|{{#switch:06 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:06<0 |{{#ifexpr:((06)round 0)!=(06) |{{#expr:12-(((0.5-(06))round 0)mod 12)}} |{{#expr:12-(((11.5-(06))round 0)mod 12)}} }} |{{#expr:(((10.5+06)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|07}} returns {{#if:07
|{{#switch:07 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:07<0 |{{#ifexpr:((07)round 0)!=(07) |{{#expr:12-(((0.5-(07))round 0)mod 12)}} |{{#expr:12-(((11.5-(07))round 0)mod 12)}} }} |{{#expr:(((10.5+07)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|08}} returns {{#if:08
|{{#switch:08 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:08<0 |{{#ifexpr:((08)round 0)!=(08) |{{#expr:12-(((0.5-(08))round 0)mod 12)}} |{{#expr:12-(((11.5-(08))round 0)mod 12)}} }} |{{#expr:(((10.5+08)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|09}} returns {{#if:09
|{{#switch:09 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:09<0 |{{#ifexpr:((09)round 0)!=(09) |{{#expr:12-(((0.5-(09))round 0)mod 12)}} |{{#expr:12-(((11.5-(09))round 0)mod 12)}} }} |{{#expr:(((10.5+09)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
Examples for month number underflows and overflows, from computed values[edit]
- {{MONTHNUMBER|-1200}} returns {{#if:-1200
|{{#switch:-1200 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-1200<0 |{{#ifexpr:((-1200)round 0)!=(-1200) |{{#expr:12-(((0.5-(-1200))round 0)mod 12)}} |{{#expr:12-(((11.5-(-1200))round 0)mod 12)}} }} |{{#expr:(((10.5+-1200)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-1201}} returns {{#if:-1201
|{{#switch:-1201 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-1201<0 |{{#ifexpr:((-1201)round 0)!=(-1201) |{{#expr:12-(((0.5-(-1201))round 0)mod 12)}} |{{#expr:12-(((11.5-(-1201))round 0)mod 12)}} }} |{{#expr:(((10.5+-1201)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-1212}} returns {{#if:-1212
|{{#switch:-1212 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-1212<0 |{{#ifexpr:((-1212)round 0)!=(-1212) |{{#expr:12-(((0.5-(-1212))round 0)mod 12)}} |{{#expr:12-(((11.5-(-1212))round 0)mod 12)}} }} |{{#expr:(((10.5+-1212)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-12}} returns {{#if:-12
|{{#switch:-12 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-12<0 |{{#ifexpr:((-12)round 0)!=(-12) |{{#expr:12-(((0.5-(-12))round 0)mod 12)}} |{{#expr:12-(((11.5-(-12))round 0)mod 12)}} }} |{{#expr:(((10.5+-12)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-11}} returns {{#if:-11
|{{#switch:-11 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-11<0 |{{#ifexpr:((-11)round 0)!=(-11) |{{#expr:12-(((0.5-(-11))round 0)mod 12)}} |{{#expr:12-(((11.5-(-11))round 0)mod 12)}} }} |{{#expr:(((10.5+-11)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-10}} returns {{#if:-10
|{{#switch:-10 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-10<0 |{{#ifexpr:((-10)round 0)!=(-10) |{{#expr:12-(((0.5-(-10))round 0)mod 12)}} |{{#expr:12-(((11.5-(-10))round 0)mod 12)}} }} |{{#expr:(((10.5+-10)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-9}} returns {{#if:-9
|{{#switch:-9 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-9<0 |{{#ifexpr:((-9)round 0)!=(-9) |{{#expr:12-(((0.5-(-9))round 0)mod 12)}} |{{#expr:12-(((11.5-(-9))round 0)mod 12)}} }} |{{#expr:(((10.5+-9)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-8}} returns {{#if:-8
|{{#switch:-8 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-8<0 |{{#ifexpr:((-8)round 0)!=(-8) |{{#expr:12-(((0.5-(-8))round 0)mod 12)}} |{{#expr:12-(((11.5-(-8))round 0)mod 12)}} }} |{{#expr:(((10.5+-8)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-7}} returns {{#if:-7
|{{#switch:-7 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-7<0 |{{#ifexpr:((-7)round 0)!=(-7) |{{#expr:12-(((0.5-(-7))round 0)mod 12)}} |{{#expr:12-(((11.5-(-7))round 0)mod 12)}} }} |{{#expr:(((10.5+-7)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-6}} returns {{#if:-6
|{{#switch:-6 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-6<0 |{{#ifexpr:((-6)round 0)!=(-6) |{{#expr:12-(((0.5-(-6))round 0)mod 12)}} |{{#expr:12-(((11.5-(-6))round 0)mod 12)}} }} |{{#expr:(((10.5+-6)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-5}} returns {{#if:-5
|{{#switch:-5 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-5<0 |{{#ifexpr:((-5)round 0)!=(-5) |{{#expr:12-(((0.5-(-5))round 0)mod 12)}} |{{#expr:12-(((11.5-(-5))round 0)mod 12)}} }} |{{#expr:(((10.5+-5)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-4}} returns {{#if:-4
|{{#switch:-4 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-4<0 |{{#ifexpr:((-4)round 0)!=(-4) |{{#expr:12-(((0.5-(-4))round 0)mod 12)}} |{{#expr:12-(((11.5-(-4))round 0)mod 12)}} }} |{{#expr:(((10.5+-4)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-3}} returns {{#if:-3
|{{#switch:-3 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-3<0 |{{#ifexpr:((-3)round 0)!=(-3) |{{#expr:12-(((0.5-(-3))round 0)mod 12)}} |{{#expr:12-(((11.5-(-3))round 0)mod 12)}} }} |{{#expr:(((10.5+-3)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-2}} returns {{#if:-2
|{{#switch:-2 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-2<0 |{{#ifexpr:((-2)round 0)!=(-2) |{{#expr:12-(((0.5-(-2))round 0)mod 12)}} |{{#expr:12-(((11.5-(-2))round 0)mod 12)}} }} |{{#expr:(((10.5+-2)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-1}} returns {{#if:-1
|{{#switch:-1 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-1<0 |{{#ifexpr:((-1)round 0)!=(-1) |{{#expr:12-(((0.5-(-1))round 0)mod 12)}} |{{#expr:12-(((11.5-(-1))round 0)mod 12)}} }} |{{#expr:(((10.5+-1)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-0.9999}} returns {{#if:-0.9999
|{{#switch:-0.9999 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-0.9999<0 |{{#ifexpr:((-0.9999)round 0)!=(-0.9999) |{{#expr:12-(((0.5-(-0.9999))round 0)mod 12)}} |{{#expr:12-(((11.5-(-0.9999))round 0)mod 12)}} }} |{{#expr:(((10.5+-0.9999)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-0.5}} returns {{#if:-0.5
|{{#switch:-0.5 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-0.5<0 |{{#ifexpr:((-0.5)round 0)!=(-0.5) |{{#expr:12-(((0.5-(-0.5))round 0)mod 12)}} |{{#expr:12-(((11.5-(-0.5))round 0)mod 12)}} }} |{{#expr:(((10.5+-0.5)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|-0.0001}} returns {{#if:-0.0001
|{{#switch:-0.0001 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:-0.0001<0 |{{#ifexpr:((-0.0001)round 0)!=(-0.0001) |{{#expr:12-(((0.5-(-0.0001))round 0)mod 12)}} |{{#expr:12-(((11.5-(-0.0001))round 0)mod 12)}} }} |{{#expr:(((10.5+-0.0001)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|0}} returns {{#if:0
|{{#switch:0 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:0<0 |{{#ifexpr:((0)round 0)!=(0) |{{#expr:12-(((0.5-(0))round 0)mod 12)}} |{{#expr:12-(((11.5-(0))round 0)mod 12)}} }} |{{#expr:(((10.5+0)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|0.0001}} returns {{#if:0.0001
|{{#switch:0.0001 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:0.0001<0 |{{#ifexpr:((0.0001)round 0)!=(0.0001) |{{#expr:12-(((0.5-(0.0001))round 0)mod 12)}} |{{#expr:12-(((11.5-(0.0001))round 0)mod 12)}} }} |{{#expr:(((10.5+0.0001)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|0.5}} returns {{#if:0
|{{#switch:0 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:0<0 |{{#ifexpr:((0)round 0)!=(0) |{{#expr:12-(((0.5-(0))round 0)mod 12)}} |{{#expr:12-(((11.5-(0))round 0)mod 12)}} }} |{{#expr:(((10.5+0)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|0.9999}} returns {{#if:0.9999
|{{#switch:0.9999 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:0.9999<0 |{{#ifexpr:((0.9999)round 0)!=(0.9999) |{{#expr:12-(((0.5-(0.9999))round 0)mod 12)}} |{{#expr:12-(((11.5-(0.9999))round 0)mod 12)}} }} |{{#expr:(((10.5+0.9999)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|12.0001}} returns {{#if:12.0001
|{{#switch:12.0001 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:12.0001<0 |{{#ifexpr:((12.0001)round 0)!=(12.0001) |{{#expr:12-(((0.5-(12.0001))round 0)mod 12)}} |{{#expr:12-(((11.5-(12.0001))round 0)mod 12)}} }} |{{#expr:(((10.5+12.0001)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|12.5}} returns {{#if:12.5
|{{#switch:12.5 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:12.5<0 |{{#ifexpr:((12.5)round 0)!=(12.5) |{{#expr:12-(((0.5-(12.5))round 0)mod 12)}} |{{#expr:12-(((11.5-(12.5))round 0)mod 12)}} }} |{{#expr:(((10.5+12.5)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|12.9999}} returns {{#if:12.9999
|{{#switch:12.9999 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:12.9999<0 |{{#ifexpr:((12.9999)round 0)!=(12.9999) |{{#expr:12-(((0.5-(12.9999))round 0)mod 12)}} |{{#expr:12-(((11.5-(12.9999))round 0)mod 12)}} }} |{{#expr:(((10.5+12.9999)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|13}} returns {{#if:13
|{{#switch:13 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:13<0 |{{#ifexpr:((13)round 0)!=(13) |{{#expr:12-(((0.5-(13))round 0)mod 12)}} |{{#expr:12-(((11.5-(13))round 0)mod 12)}} }} |{{#expr:(((10.5+13)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|14}} returns {{#if:14
|{{#switch:14 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:14<0 |{{#ifexpr:((14)round 0)!=(14) |{{#expr:12-(((0.5-(14))round 0)mod 12)}} |{{#expr:12-(((11.5-(14))round 0)mod 12)}} }} |{{#expr:(((10.5+14)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|24}} returns {{#if:24
|{{#switch:24 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:24<0 |{{#ifexpr:((24)round 0)!=(24) |{{#expr:12-(((0.5-(24))round 0)mod 12)}} |{{#expr:12-(((11.5-(24))round 0)mod 12)}} }} |{{#expr:(((10.5+24)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|1200}} returns {{#if:1200
|{{#switch:1200 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:1200<0 |{{#ifexpr:((1200)round 0)!=(1200) |{{#expr:12-(((0.5-(1200))round 0)mod 12)}} |{{#expr:12-(((11.5-(1200))round 0)mod 12)}} }} |{{#expr:(((10.5+1200)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|1201}} returns {{#if:1201
|{{#switch:1201 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:1201<0 |{{#ifexpr:((1201)round 0)!=(1201) |{{#expr:12-(((0.5-(1201))round 0)mod 12)}} |{{#expr:12-(((11.5-(1201))round 0)mod 12)}} }} |{{#expr:(((10.5+1201)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
- {{MONTHNUMBER|1212}} returns {{#if:1212
|{{#switch:1212 |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:1212<0 |{{#ifexpr:((1212)round 0)!=(1212) |{{#expr:12-(((0.5-(1212))round 0)mod 12)}} |{{#expr:12-(((11.5-(1212))round 0)mod 12)}} }} |{{#expr:(((10.5+1212)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
Example for invalid month name[edit]
- {{MONTHNUMBER|xx}} returns {{#if:xx
|{{#switch:xx |january|jan=1 |february|feb=2 |march|mar=3 |apr|april=4 |may=5 |june|jun=6 |july|jul=7 |august|aug=8 |september|sep|sept=9 |october|oct=10 |november|nov=11 |december|dec=12 |{{#ifexpr:xx<0 |{{#ifexpr:((xx)round 0)!=(xx) |{{#expr:12-(((0.5-(xx))round 0)mod 12)}} |{{#expr:12-(((11.5-(xx))round 0)mod 12)}} }} |{{#expr:(((10.5+xx)round 0)mod 12)+1}} }} }} |Missing required parameter 1=month!
}}
See also[edit]
{{#switch: right
|left =|[ | ]95%
}}|[ | ]95%
}}|center = Template:Center |#default = Error in Template:Align: the alignment setting "right" is invalid. }}
|}}
}}{{#ifeq: |yes
|}}
- {{Currentdate}} – Time, day of week, and date in MDY format and time zone
- {{Date}} – Date in chosen format
- {{DATE}} – Month and year, prefixed by "date=" (for use with templates through substitution)
- {{Now}} – Same as {{Currentdate}} but in a sentence
- {{Plain now}} – Date in DMY format, and time
- {{Right now}} – Blue banner with time and current number of Wikipedia articles
- {{Right now (User message)}} – Orange banner with time and current number of Wikipedia articles
- {{TODAY}} – Date in DMY
}}{{#ifeq: |yes
|}}
- {{NEXTYEAR}}
- {{CURRENTWEEKDAYABBREV}}
- {{CURRENTWEEKDAYNAME}}
- {{Day}}
- {{MONTH}}
- {{MONTHNAME}}
- {{MONTHABBREV}}
- {{MONTHNUMBER}}
- {{CURRENTWEEKDAY}}
- {{WEEKDAY}}
- {{WEEKDAYNAME}}
- {{WEEKDAYABBREV}}
- {{CURRENTYEARCC}}
- {{CURRENTYEARYY}}
- {{CURRENTCENTURY}}
- {{CURRENTMONTHDAYS}}
- {{CURRENTISOYEAR}}
- {{CURRENTMINUTE}}
- {{JULIANDAY}}
}}{{#ifeq: |yes
|}}
- {{Calendar}}
- {{Calendar clock with Wikipedia stats}}
- {{Clock}}
- {{Digital clock}}
- {{Digital clock and date}}
The above documentation is transcluded from Template:MONTHNUMBER/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |
{{#if:|
[[Category:Template documentation pages{{#translation:}}]] }}