MonthName Function


MonthName Function

Class

Microsoft.VisualBasic.DateAndTime

Syntax

     Dim result As String = MonthName(month[, abbreviate]) 


month (required; Integer)

The ordinal number of the month, from 1 to 13 (that's right, 13).


abbreviate (optional; Boolean)

A flag to indicate if an abbreviated month name should be returned. The default value is False.

Description

The MonthName function returns the name of a given month, based on the current regional settings in effect. For example, a month of 1 in an English-speaking region returns "January," or "Jan" if abbreviate is set to true.

Usage at a Glance

  • The month value must be an integer; it cannot be a date. Use the Month function to obtain a month number from a date.

  • Some regional calendar systems support 13 months. A 13th month is only supported under such calendars; when a 12-month calendar is in effect, a value of 13 returns an empty string.

  • If month has a fractional portion, it is rounded before use.

  • MonthName with abbreviate set to False is the equivalent of Format(dateValue,"MMMM").

  • MonthName with abbreviate set to TRue is the equivalent of Format(dateValue,"MMM").

See Also

Month Function, WeekdayName Function




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net