This documentation is archived and is not being maintained.

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
public string GetDayName(
 DayOfWeek dayofweek
public: String* GetDayName(
 DayOfWeek dayofweek
public function GetDayName(
   dayofweek : DayOfWeek
) : String;


A System.DayOfWeek value.

Return Value

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


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


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"


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