This topic has not yet been rated - Rate this topic

DateTimeFormatInfo.DayNames Property

May 02, 2013

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

Namespace:  System.Globalization
Assembly:  mscorlib (in mscorlib.dll)
public string[] DayNames { get; set; }

Property Value

Type: System.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".
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 7.

InvalidOperationException

The DateTimeFormatInfo object is read-only.

If setting this property, the array must be one-dimensional and must have exactly seven elements.

If a custom format string includes the "dddd" format specifier, DateTime.ToString returns the value of the appropriate member of DayNames in place of "dddd" in the custom format string.

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

Windows Phone OS

Supported in: 8.0, 7.1, 7.0

Windows Phone

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.