DateTimeFormatInfo.MonthNames Property

May 11, 2014

Gets or sets a one-dimensional array of type String containing the culture-specific full names of the months.

Namespace:  System.Globalization
Assembly:  mscorlib (in mscorlib.dll)

public string[] MonthNames { get; set; }

Property Value

Type: System.String []
A one-dimensional array of type String containing the culture-specific full names of the months. In a 12-month calendar, the 13th element of the array is an empty string. The array for InvariantInfo contains "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", and "".

ExceptionCondition
ArgumentNullException

An attempt was made to set the property to null.

ArgumentException

An attempt was made to set the property to a multidimensional array or to a single-dimensional array with a length that is not exactly 13.

InvalidOperationException

The DateTimeFormatInfo object is read-only.

When this property is set, the array must be one-dimensional and must have exactly 13 elements. Calendar objects accommodate calendars with 13 months.

If a custom date and time format string includes the "MMMM" format specifier, DateTime.ToString returns the appropriate element from the MonthNames property array in place of "MMMM" in the custom format string.

This property is affected if the value of the Calendar property changes.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft