asp.net.ph

DateTimeFormatInfo.AbbreviatedMonthNames Property

System.Globalization Namespace   DateTimeFormatInfo Class


Sets or retrieves a one-dimensional array of type String containing the culture-specific abbreviated names of the months.

[ VB ]
public Property AbbreviatedMonthNames As String ( ) 

[ C# ]
public string [ ] AbbreviatedMonthNames {get; set;}

[ C++ ]
public: __property String* get_AbbreviatedMonthNames ( );
public: __property void set_AbbreviatedMonthNames ( String* __gc [ ] );

[ JScript ]
function get AbbreviatedMonthNames ( ) : String [ ];
public function set AbbreviatedMonthNames ( String [ ] );

Property Value

A one-dimensional array of type String containing the culture-specific abbreviated names of the months. In a 12-month calendar, the 13th element of the array is an empty string. The array for InvariantInfo contains "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", and "".

Exceptions


Exception Type Condition
ArgumentNullException The property is being set to a null reference ( Nothing in Visual Basic ).
ArgumentException The property is being set to an array that is multidimensional or whose length is not exactly 13.
InvalidOperationException The property is being set and the DateTimeFormatInfo is read-only.

Remarks

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

If the custom pattern includes the format pattern "MMM", DateTime.ToString displays the value of AbbreviatedMonthNames in place of the "MMM" in the format pattern.

This property is affected if the value of the Calendar property changes. If the selected Calendar does not support abbreviated month names, the array contains the full month names.

Example

This example shows how you can create a DateTimeFormatInfo object for a given culture, to gain access to the AbbreviatedMonthNames property for the specified culture.

First, you need to instantiate a CultureInfo object with the specified culture name, and then retrieve the CultureInfo.DateTimeFormat property.

This returns a DateTimeFormatInfo instance specific to the given culture, which you can then use to get to any DateTimeFormatInfo method or property, such as AbbreviatedMonthNames.

 Show me 

See Also

DateTimeFormatInfo Members   AbbreviatedDayNames   MonthNames   GetAbbreviatedMonthName Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph