WeekDayName function
Returns a string representing a specified day of the week.
WeekdayName(weekday, abbreviate, firstdayofweek)
parameter
weekday
Required option. The numerical definition of a day of the week. The numerical definition of each day depends onfirstdayofweekParameter settings.
Abbreviate
Optional. Boolean value, indicating whether the abbreviation represents the name of each day of the week. If omitted, the default value isFalse, that is, the name of each day of the week is not abbreviated.
Firstdayofweek
Optional. Specifies the value of the first day of the week. For values, see the Settings section.
set up
The firstdayofweek parameter has the following values:
constant | value | describe |
---|---|---|
vbUseSystem | 0 | Use the Regional Language Support (NLS) API settings. |
vbSunday | 1 | Sunday (default) |
vbMonday | 2 | Monday |
vbTuesday | 3 | Tuesday |
vbWednesday | 4 | Wednesday |
vbThursday | 5 | Thursday |
vbFriday | 6 | Friday |
vbSaturday | 7 | Saturday |
illustrate
The following example usesWeekDayNameThe function returns the specified day:
Dim MyDateMyDate = WeekDayName(6, True) 'MyDate
IncludeFri
。