Latest web development tutorials

VBScript MonthName function

VBScript Reference Complete VBScript Reference

MonthName function returns the name of the specified month.

grammar

MonthName(month[,abbreviate])

参数 描述
month 必需。规定月的数字。(比如一月是 1,二月是 2,依此类推。)
abbreviate 可选。一个布尔值,指示是否缩写月份名称。默认是 False。

Examples

Example 1

Get the name of the eighth month:

<script type="text/vbscript">

document.write(MonthName(8))

</script>

Examples of the above output:

August

try it"

Example 2

Get the first eight months of the abbreviation:

<script type="text/vbscript">

document.write(MonthName(8,True))

</script>

Examples of the above output:

Aug

try it"


VBScript Reference Complete VBScript Reference