MonthName - Built-in Date & Time Function¶
Purpose¶
MonthName returns the name of the month from a datetime expression.
Syntax¶
MonthName(datetime [, bool])
Arguments¶
| Argument | Required | Description |
|---|---|---|
datetime |
Yes | Any valid datetime expression from which the month will be returned. |
bool |
No | When true, the returned name is the abbreviated name of the month (e.g., Sep vs. September). |
Returns¶
String
See also¶
- Date
- DateAdd
- DateDiff
- DatePart
- DateValue
- DateSerial
- Day
- Hour
- InAgedToDays
- InLast4WeeksToSunday
- InLast7Days
- InLastFullMonth
- InLastFullWeek
- InLastYearMTD
- InLastYearYTD
- InLeapYear
- Minute
- Month
- Now
- Second
- Time
- TimeSerial
- TimeValue
- WeekAgo
- Weekday
- WeekdayName
- Year
Example¶
// returns "October" when PC’s regional settings are set to English
Return MonthName(DateSerial(2014,10,30))
// returns "Oct" when PC’s regional settings are set to English
Return MonthName(DateSerial(2014,10,30),true)
Notes¶
- When
datetimecannot be converted to a datetime value, a runtime error is generated. - MonthName uses the locale settings to return the name of the month (e.g., February in English and Februari in Dutch).
- The function returns a string.