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
The FirstDayOfWeekValue argument can have one of the following settings.
Enumeration value | Value | Description |
---|---|---|
FirstDayOfWeek.System | 0 | First day of week specified in system settings (default) |
FirstDayOfWeek.Sunday | 1 | Sunday |
FirstDayOfWeek.Monday | 2 | Monday (complies with ISO standard 8601, section 3.17) |
FirstDayOfWeek.Tuesday | 3 | Tuesday |
FirstDayOfWeek.Wednesday | 4 | Wednesday |
FirstDayOfWeek.Thursday | 5 | Thursday |
FirstDayOfWeek.Friday | 6 | Friday |
FirstDayOfWeek.Saturday | 7 | Saturday |
Exception type | Error number | Condition |
---|---|---|
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.
MonthName Function |