Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section


Returns a string indicating the specified month.




month The numeric designation of the month. For example, January is 1, February is 2, and so on.
abbreviate Optional — Boolean value that indicates if the month name is to be abbreviated. If omitted, the default is False (0), which means that the month name is not abbreviated.


The following example uses the MonthName and Month functions to return the month name for a date expression:

Dim MName
Mydate = "1/12/1953"
MName = MonthName(Month(Mydate))
Println MName
Copy code to clipboard

The following example uses the MonthName and Date functions to return the abbreviated month name for the current date:

Dim MName
CurrDate = Date
MNum = Month(CurrDate)
MName = MonthName(MNum,1)
Println MName
Copy code to clipboard

In the following example, a month number is out of the range of 1 through 12. MonthName returns a question mark:

Dim MyVar
MyVar = MonthName(13)
Println MyVar
Copy code to clipboard

See Also