Export (0) Print
Expand All

DateTimeFormatInfo.GetDayName Method

Returns the culture-specific full name of the specified day of the week based on the CultureInfo of the current thread.

[Visual Basic]
Public Function GetDayName( _
   ByVal dayofweek As DayOfWeek _
) As String
[C#]
public string GetDayName(
 DayOfWeek dayofweek
);
[C++]
public: String* GetDayName(
 DayOfWeek dayofweek
);
[JScript]
public function GetDayName(
   dayofweek : DayOfWeek
) : String;

Parameters

dayofweek
A System.DayOfWeek value.

Return Value

The culture-specific full name of the day of the week represented by dayofweek.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException dayofweek is not a valid System.DayOfWeek value.

Remarks

For the default invariant DateTimeFormatInfo, this method returns a string from the GregorianCalendar:

dayofweek Return Value
Sunday "Sunday"
Monday "Monday"
Tuesday "Tuesday"
Wednesday "Wednesday"
Thursday "Thursday"
Friday "Friday"
Saturday "Saturday"

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DateTimeFormatInfo Class | DateTimeFormatInfo Members | System.Globalization Namespace | CultureInfo | GregorianCalendar | DayNames | System.DayOfWeek

Show:
© 2015 Microsoft