asp.net.ph

DateTimeFormatInfo.DayNames Property

System.Globalization Namespace   DateTimeFormatInfo Class


Sets or retrieves a one-dimensional array of type String containing the culture-specific full names of the days of the week.

[ VB ]
public Property DayNames As String ( ) 

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

[ C++ ]
public: __property String* get_DayNames ( );
public: __property void set_DayNames ( String* __gc [ ] );

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

Property Value

A one-dimensional array of type String containing the culture-specific full names of the days of the week. The array for InvariantInfo contains "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday".

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 7.
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 seven elements.

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

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

Example

This example shows how you can create a DateTimeFormatInfo object for a given culture, to gain access to the DayNames 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 DayNames.

 Show me 

See Also

DateTimeFormatInfo Members   AbbreviatedDayNames   MonthNames   GetDayName 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