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 [ ] );
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".
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.
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
DateTimeFormatInfo Members AbbreviatedDayNames MonthNames GetDayName