Skip to main content

WeekdayName

Returns a string indicating the specified day of the week.

Synopsis

WeekdayName(weekday[,abbreviate[,firstdayofweek]])

Arguments

weekday An integer 1 through 7, inclusive, designating the day of the week. The numeric value of each day depends on the firstdayofweek setting.
abbreviate Optional — Boolean value that indicates if the weekday name is to be returned fully spelled out, or abbreviated. If omitted, the default is False, which means that the weekday name is returned fully spelled out.
firstdayofweek Optional — Numeric value indicating the first day of the week. See Description section for values.

Description

The WeekdayName function returns a day name corresponding to the day of the week represented by weekday. The first day of the week is, by default, Sunday, or the current NLS day of week setting overriding this default system-wide.

The firstdayofweek argument can be used to set the first day of the week for this statement to the day of your choosing. The firstdayofweek argument can have the following values:

Constant Value Description
vbUseSystem 0 Use National Language Support (NLS) API setting.
vbSunday 1 Sunday
vbMonday 2 Monday
vbTuesday 3 Tuesday
vbWednesday 4 Wednesday
vbThursday 5 Thursday
vbFriday 6 Friday
vbSaturday 7 Saturday

Examples

The following example uses the WeekDay and WeekDayName functions to return the name of the day of the week for the specified date:

Dim WDayNum,WDayName
WDayNum = Weekday("11/1/2005")
Println WDayNum
WDayName = WeekdayName(3)
Println WDayName

November 1, 2005 is a Tuesday.

See Also

FeedbackOpens in a new tab