MonthName - returns a month name for the specified month number or date.

Return to Introduction  Previous page  Next page

$return = MonthName(month[,abbreviate])

$return = MonthName(date[,abbreviate][,date_format])

Where:

 

$return

The month name of the specified month of the year.

month

The number of the the month of the year. See the Month script command.

date

The input date.

abbreviate

Specify "true" to return an abbreviated month name. Specify "false" to return the full month name. ("false" is the default)

date_format

can be one of the following:

DMY (date is in DD/MM/YYYY format.)

MDY (date is in MM/DD/YYYY format.)

YMD (date is in YYYY/MM/DD or YYYY-MM-DD format.)

 

date_format may be omitted, in which case the date format is taken from the "Option DateFormat" command. If the "Option DateFormat" command is also omitted, then the date format is assumed to be the system short date format.

month, date and date_format may be a variables.

The MonthName command returns the month name for the specified month of the year.

Examples

$MonthName = MonthName($DATE)

'Returns today's month name in system short  date format

$MonthName = MonthName("2015-01-01",YMD)

'Returns January

$MonthName = MonthName("2015-02-01",true,ymd)

'Returns Feb

 

Sample Script

' Display the date.

$Today = $DATE

$DayName = WeekdayName($Today)

$DayNumber = Day($Today)

$MonName = MonthName($Today)

$Year = Year($Today)

MsgBox("Today is "  & $DayName & ", " & $MonName _

                       & " " & $DayNumber & ", "  & $Year)

exit

 

See Also:

 

DateAdd

Day

Month

Weekday

WeekdayName

Year


TN3270 Plus is continually being improved. To learn more about the latest enhancements, please review our Version History web page.