idlastro / Astronomical Utilities: MONTH_CNV

[Source code]

NAME
MONTH_CNV
PURPOSE
Convert between a month name and  the equivalent number 
EXPLANATION (e.g.,
For example, converts from 'January' to 1  or vice-versa.
CALLING SEQUENCE
Result = MONTH_CNV( MonthInput, [/UP, /LOW, /SHORT ] )
INPUTS
MonthInput - either a string ('January', 'Jan', 'Decem', etc.) or
        an number from 1 to 12.  Scalar or array. 
OPTIONAL KEYWORDS
UP - if set and if a string is being returned, it will be in all
        uppercase letters.
LOW - if set and if a string is being returned, it will be in all 
        lowercase letters.
SHORT - if set and if a string is being returned, only the first
        three letters are returned.
OUTPUTS
If the input is a string, the output is the matching month number.If
        an input string isn't a valid month name, -1 is returned.
If the input is a number, the output is the matching month name.  The
        default format is only the first letter is capitalized.
EXAMPLE
To get a vector of all the month names:
        Names = month_cnv(indgen(12)+1)
MODIFICATION HISTORY
Written by:     Joel Wm. Parker, SwRI, 1998 Dec 9