VBScript MonthName Function

VBScript MonthName :

VBScript MonthName() function returns the name of the month for the specified date.

Syntax

MonthName(month[,toAbbreviate]) 

Parameter Description

ParameterDescription
Month a Required Parameter. It specifies the number of the month.
toAbbreviate an Optional Parameter. A Boolean value Boolean value that indicates if the month name is to be abbreviated. If left blank the default value would be taken as False.

Example

<!DOCTYPE html>
<html>
<body>
<script language="vbscript" type="text/vbscript">
document.write("Ex 1 : " & MonthName(06,True)  & "<br />")
document.write("Ex 2 : " & MonthName(06,false) & "<br />")
document.write("Ex 3 : " & MonthName(08,True)  & "<br />")
document.write("Ex 4 : " & MonthName(08,false) & "<br />")
</script>
</body>
</html>

Output :

After running above script in IE we will get following output -

Ex 1 : Jun
Ex 2 : June
Ex 3 : Aug
Ex 4 : August