MonthName - VBScript


MonthName

Overview

Retrieves the name of the specified month using the system’s default language settings.

Syntax

MonthName(Month)

Parameters

  • Month: Required. Numerical representation of the month (1-12).

Options/Flags

None

Examples

  1. Get the name of the fourth month:
Dim monthName
monthName = MonthName(4)
  1. Assign the month name to a variable:
Dim monthName, monthNumber
monthNumber = 9
monthName = MonthName(monthNumber)

Common Issues

  • Ensure the specified month number is within the range 1-12.
  • The returned month name will depend on the system’s default language settings.

Integration

  • Use with other VBScript date manipulation functions, such as Date and Day.
  • Combine with the Format function to customize the output month name format.

Related Commands

  • Date
  • Day
  • Format