Scripting > UNICOM Intelligence Function Library > Date and time functions > MonthName
 
MonthName
Returns a string indicating the specified month.
Syntax
MonthName(Val [, Abbreviate [, Locale ] ])
Parameters
Val
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 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.
Remarks
For locales that do not have a 13th month (which is most locales), the return value is a zero-length string when Val is 13.
If Locale is specified, it is not used for error messages.
If Val is NULL, the return value is a zero-length string. Otherwise, an error occurs if Val 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 would typically be “December”.
MonthName(12)
To return the abbreviated name of the 12th month, set Abbreviate to True. In an English-speaking locale, this would typically return “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 next example uses the MonthName and Now functions to return the name of the current month:
MonthName(Now())
See also
DateAdd
Date and time functions