Developer Documentation Library > UNICOM Intelligence Function Library > Date and time functions > MonthName
 
MonthName
Returns a string indicating the specified month.
Syntax
MonthName(<value> [, <abbreviate> [, <locale> ] ])
Parameters
<value>
Type: None
An integer between 1 and 13 representing the month, or a date.
<abbreviate>
Type: Boolean
(Optional.) Whether a short form of the month name is to be used. The default value is False.
<locale>
Type: Long
(Optional.) The output locale to use for regional variations in month names. If Locale is omitted or negative, or does not match a known Locale ID (LCID), the current output locale is used.
(return)
Type: Text
The name of the month, as specified for the output locale.
Notes
For locales that do not have a 13th month (which is most locales), the return value is a zero-length string when <value> is 13.
If Locale is specified, it is not used for error messages.
If <value> is NULL, the return value is a zero-length string. Otherwise, an error occurs if <value> is not in the range 1 to 13 or is not a valid date.
Examples
This example returns the full name of the 12th month. In an English-speaking locale, this is typically “December”.
MonthName(12)
To return the abbreviated name of the 12th month, set <abbreviate> to True. In an English-speaking locale, this typically returns “Dec”.
MonthName(12, True)
To return the month name for a specific locale, set <locale> to a Locale ID (LCID) number. In the following example, the Chinese (Traditional) name for the 6th month is returned.
MonthName(6, , 1028)
The following example uses the MonthName and Now functions to return the name of the current month:
MonthName(Now())
See also
DateAdd
Date and time functions