VBScript » Functions » WeekdayName

Syntax:
WeekdayName(WeekDay, Abbreviate, FirstDayofWeek)
WeekDay
The WeekDay argument is the number representing the day of the week as defined below by the value in the Date And Time Constants table.
Abbreviate
The optional Abbreviate argument is a Boolean value which gives the option of having the returned day name being abbreviated to the first three characters.

If set to True, the name will be abbreviated. If set to False the name will not be abbreviated.
FirstDayofWeek
The optional FirstDayofWeek argument must only use the constants or values defined in the Date and Time Constants table.

The WeekdayName function returns the full spelling of the name of the day of the week.

Date and Time Constants

CONSTANT VALUE DESCRIPTION
VBSunday 1 Sunday
VBMonday 2 Monday
VBTuesday 3 Tuesday
VBWednesday 4 Wednesday
VBThursday 5 Thursday
VBFriday 6 Friday
VBSaturday 7 Saturday
VBFirstJan1 1 Week of January 1
VBFirstFourDays 2 First week of the year that has at least four days
VBFirstFullWeek 3 First full week of the year
VBUseSystem 0 Use the date format of the computer's regional settings
VBUseSystemDayOfWeek 0 Use the first full day of the week as defined by the system settings

Examples

Code:
<% =WeekdayName(7) %>
Output:
Saturday
Language(s): VBScript
Code:
<% =WeekdayName(7, True) %>
Output:
Sat
Language(s): VBScript
Code:
<% =WeekdayName(6, False, 2) %>
Output:
Saturday
Language(s): VBScript
Code:
<% =WeekdayName(6, False, VBMonday) %>
Output:
Saturday
Explanation:

In this example, Monday is defined to be the first day of the week. Therefore, Saturday becomes 6.

Language(s): VBScript

See Also: