Template:MONTH

From PS3 Developer wiki
Jump to navigation Jump to search
[edit] Template documentation

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 1
{{MONTH|2}} returns 2
{{MONTH|3}} returns 3
{{MONTH|4}} returns 4
{{MONTH|5}} returns 5
{{MONTH|6}} returns 6
{{MONTH|7}} returns 7
{{MONTH|8}} returns 8
{{MONTH|9}} returns 9
{{MONTH|10}} returns 10
{{MONTH|11}} returns 11
{{MONTH|12}} returns 12
Examples for month numbers with extra leading zero:
{{MONTH|01}} returns 1
{{MONTH|02}} returns 2
{{MONTH|03}} returns 3
{{MONTH|04}} returns 4
{{MONTH|05}} returns 5
{{MONTH|06}} returns 6
{{MONTH|07}} returns 7
{{MONTH|08}} returns 8
{{MONTH|09}} returns 9
Examples for month number underflows and overflows, from computed values:
{{MONTH|-1200}} returns 12
{{MONTH|-1201}} returns 11
{{MONTH|-1212}} returns 12
{{MONTH|-12}} returns 12
{{MONTH|-11}} returns 1
{{MONTH|-10}} returns 2
{{MONTH|-9}} returns 3
{{MONTH|-8}} returns 4
{{MONTH|-7}} returns 5
{{MONTH|-6}} returns 6
{{MONTH|-5}} returns 7
{{MONTH|-4}} returns 8
{{MONTH|-3}} returns 9
{{MONTH|-2}} returns 10
{{MONTH|-1}} returns 11
{{MONTH|-0.9999}} returns 11
{{MONTH|-0.5}} returns 11
{{MONTH|-0.0001}} returns 11
{{MONTH|0}} returns 12
{{MONTH|0.0001}} returns 12
{{MONTH|0.5}} returns 12
{{MONTH|0.9999}} returns 12
{{MONTH|12.0001}} returns 12
{{MONTH|12.5}} returns 12
{{MONTH|12.9999}} returns 12
{{MONTH|13}} returns 1
{{MONTH|14}} returns 2
{{MONTH|24}} returns 12
{{MONTH|1200}} returns 12
{{MONTH|1201}} returns 1
{{MONTH|1212}} returns 12
Example for invalid month name:
{{MONTH|xxx}} returns Expression error: Unrecognized word "xxx".
See also:
Template:MONTHNAME
Template:MONTHABBREV
Template:MONTHNUMBER