Returns a String value containing the name of the specified weekday.
Public Function WeekdayName( _ ByVal WeekDay As Integer, _ Optional ByVal Abbreviate As Boolean = False, _ Optional ByVal FirstDayOfWeekValue As FirstDayOfWeek = FirstDayOfWeek.System _ ) As String
- Required. Integer. The numeric designation for the weekday, from 1 through 7; 1 indicates the first day of the week and 7 indicates the last day of the week. The identities of the first and last days depend on the setting of FirstDayOfWeekValue.
- Optional. Boolean value that indicates if the weekday name is to be abbreviated. If omitted, the default is False, which means the weekday name is not abbreviated.
- Optional. A value chosen from the FirstDayOfWeek enumeration that specifies the first day of the week. If not specified, FirstDayOfWeek.System is used.
The FirstDayOfWeekValue argument can have one of the following settings.
|FirstDayOfWeek.System||0||First day of week specified in system settings (default)|
|FirstDayOfWeek.Monday||2||Monday (complies with ISO standard 8601, section 3.17)|
|Exception type||Error number||Condition|
|ArgumentException||5||WeekDay is less than 1 or greater than 7, or FirstDayOfWeekValue is less than 0 or greater than 7.|
The string returned by WeekdayName depends not only on the input arguments, but also on the Regional Options settings specified in the Windows Control Panel.
If WeekDay is less than 1 or more than 7, or if FirstDayOfWeekValue is less than 0 or more than 7, an ArgumentException error occurs.
Note WeekdayName uses the current calendar setting from the CurrentCulture property of the CultureInfo class in the System.Globalization namespace. The default CurrentCulture values are determined by Control Panel settings.
Assembly: Microsoft Visual Basic .NET Runtime (in Microsoft.VisualBasic.dll)