Collapse the table of content
Expand the table of content
Expand Minimize

DayOfWeek Enumeration

Specifies the day of the week.

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

[<SerializableAttribute>]
[<ComVisibleAttribute(true)>]
type DayOfWeek

Member nameDescription
Supported by the XNA FrameworkSupported by Portable Class LibraryFridayIndicates Friday.
Supported by the XNA FrameworkSupported by Portable Class LibraryMondayIndicates Monday.
Supported by the XNA FrameworkSupported by Portable Class LibrarySaturdayIndicates Saturday.
Supported by the XNA FrameworkSupported by Portable Class LibrarySundayIndicates Sunday.
Supported by the XNA FrameworkSupported by Portable Class LibraryThursdayIndicates Thursday.
Supported by the XNA FrameworkSupported by Portable Class LibraryTuesdayIndicates Tuesday.
Supported by the XNA FrameworkSupported by Portable Class LibraryWednesdayIndicates Wednesday.

The DayOfWeek enumeration represents the day of the week in calendars that have seven days per week. The value of the constants in this 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).

This enumeration is useful when it is desirable to have a strongly typed specification of the day of the week. For example, this enumeration is the type of the property value for the DateTime.DayOfWeek property.

The members of the DayOfWeek enumeration are not localized. To return the localized name of the day of the week, call the DateTime.ToString(String) or the DateTime.ToString(String, IFormatProvider) method with either the "ddd" or "dddd" format strings. The former format string produces the abbreviated weekday name; the latter produces the full weekday name.

The following example demonstrates the DateTime.DayOfWeek property and the DayOfWeek enumeration.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft