System.Globalization.DateTimeFormatInfo.DayNames Property

Gets or sets a one-dimensional string array that contains the culture-specific full names of the days of the week.

Syntax

public string[] DayNames { get; set; }

Value

A one-dimensional array of type string containing the full names of the days of the week.

Exceptions

TypeReason
ArgumentNullExceptionThe value specified for a set operation is a null reference.
ArgumentExceptionThe value specified for a set operation is not an array with exactly 7 elements.
InvalidOperationExceptionThe current instance is read-only and a set operation was attempted.

Remarks

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, the DateTime.ToString method includes the value of the appropriate DateTimeFormatInfo.DayNames member in place of "dddd" in the result string.

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

Requirements

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0