Export (0) Print
Expand All

DateTimeOffset::DayOfWeek Property

Gets the day of the week represented by the current DateTimeOffset object.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public:
property DayOfWeek DayOfWeek {
	DayOfWeek get ();
}

Property Value

Type: System::DayOfWeek
One of the enumeration values that indicates the day of the week of the current DateTimeOffset object.

The value of the constants in the DayOfWeek enumeration ranges from DayOfWeek::Sunday to DayOfWeek::Saturday. If cast to an integer, its value ranges from zero (which indicates DayOfWeek::Sunday) to six (which indicates DayOfWeek::Saturday).

You can also display the weekday name of a particular date by using the "D" format specifier or the "dddd" custom format specifier. For example:

No code example is currently available or this language may not be supported.

Note that the string returned by calling the ToString method of the DayOfWeek enumeration member that is returned by this property is not localized. To extract a string that contains the weekday name of the current culture or of a specific culture, call the ToString method with the "dddd" custom format specifier. For example, the following code displays the weekday name for a date using the fr-fr culture.

No code example is currently available or this language may not be supported.

The following example displays the weekday name of the first day of each month of the year 2008.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5 SP1, 3.0 SP1, 2.0 SP1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2015 Microsoft