This site is supported by donations to The OEIS Foundation.

Template:Month/doc

From OeisWiki
Jump to: navigation, search

This documentation subpage contains instructions, categories, or other information for Template:Month. [<Edit> Template:Month]

[⧼Purge⧽ Template:Month/doc]

The {{month}} date and time function template changes a full month name, a standard three letter month abbreviation or a month number (up to two digits) from 1 to 12, with or without a leading zero, to the standard three letter month abbreviation.

Usage

{{month|a full month name, a standard three letter month abbreviation or a month number (up to two digits) from 1 to 12, with or without a leading zero}}

or

{{month}} which defaults to local standard three letter month abbreviation of OEIS Wiki server

Examples

Examples with valid input

Code Result
{{month|january}} Jan
{{month|January}} Jan
{{month|jul}} Jul
{{month|SEPTEMBER}} Sep
{{month|4}} Apr
{{month|06}} Jun
{{month|007}} Jul
{{month}} Apr

Examples with invalid input

Code Result
{{month|Hexember}} Month error: invalid input
{{month|13}} Month error: invalid input
{{month|-1}} Month error: invalid input
{{month|6.5}} Month error: invalid input

Code


<!-- The second column will have its use! For third column, leading zeros are ignored. -->

{{#switch: {{lc: {{{1|{{lc: {{{1|{{LOCALMONTHNAME}}}}} }}}}} }}
  | january=Jan   | jan=Jan |  1=Jan
  | february=Feb  | feb=Feb |  2=Feb
  | march=Mar     | mar=Mar |  3=Mar 
  | april=Apr     | apr=Apr |  4=Apr
  | may=May       | may=May |  5=May
  | june=Jun      | jun=Jun |  6=Jun
  | july=Jul      | jul=Jul |  7=Jul
  | august=Aug    | aug=Aug |  8=Aug
  | september=Sep | sep=Sep |  9=Sep
  | october=Oct   | oct=Oct | 10=Oct   
  | november=Nov  | nov=Nov | 11=Nov  
  | december=Dec  | dec=Dec | 12=Dec  
  | {{error| Month error: invalid input}}
}}

See also

  • {{daynum}} gives the weekday number (0 to 6) for (Sun to Sat)
  • {{day}} gives the standard three letter weekday abbreviation.
  • {{fullday}} gives the full weekday name.


  • {{monthnum}} gives the month number (padded left with 0 if necessary to get two decimal digits) (01 to 12)
  • {{month}} gives the standard three letter month abbreviation.
  • {{fullmonth}} gives the full month name.
  • {{days in month}} (or {{monthdays}}) gives the number of days in a month (for any year from 1 AD to 10000 AD)


  • {{yearday}} returns the day of year from year, month and monthday (for any year from 1 AD to 10000 AD)
  • {{ifleapyear}} or {{if leap year}} returns different values depending on whether a given year is a leap year or a common year (for any year from 1 AD to 10000 AD)
  • {{is leap year}} predicate function template returns 1 (if true) or 0 (if false) depending on whether a given year is a leap year or a common year (for any year from 1 AD to 10000 AD)
  • {{Century}} returns the century for any nonzero (negative or positive) year
  • {{Millennium}} returns the millennium for any nonzero (negative or positive) year


  • {{to day of CE}} returns the day of CE (Christ Era) from year, month and monthday (for any year from 1 AD to 10000 AD)
  • {{from day of CE}} returns year, month and monthday (for any year from 1 AD to 10000 AD) from the day of CE (Christ Era)


  • {{date}} for date mathematics (for any year from 1 AD to 10000 AD) (returns the date offset a specified number of days from a given date)
  • {{days between}} for date mathematics (for any years from 1 AD to 10000 AD) (returns the number of days between two dates)