O'Reilly logo

VBScript in a Nutshell, 2nd Edition by Ron Petrusha, Matt Childs, Paul Lomax

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

MonthName Function

Syntax

MonthName monthnumber [, abbreviate]
monthnumber

Use: Required

Data Type: Long

The ordinal number of the month, from 1 to 12.

abbreviate

Use: Optional

Data Type: Boolean

A flag to indicate whether an abbreviated month name should be returned.

Return Value

A String.

Description

Returns the month name of a given month. For example, 1 returns January, or if abbreviate is True, Jan.

Rules at a Glance

The default value for abbreviate is False.

Programming Tips and Gotchas

monthnumber must be an integer or a long; it can’t be a date. Use DatePart("m", dateval ) to obtain a month number from a date.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required