VBScript WeekdayName Function

Definition and Usage

The WeekdayName function can return the name of the day of the week specified in a week.

Note:In the English Windows environment, the return value is "Sunday", "Monday", ... ...

Syntax

WeekdayName(weekday[,abbreviate[,firstdayofweek]])
Parameters Description
weekday Required. The numeric value of the day of the week.
abbreviate Optional. Boolean value indicating whether to abbreviate the weekday name.
firstdayofweek

Optional. Specifies the first day of the week.

The following values can be used:

  • 0 = vbUseSystemDayOfWeek - Use NLS API settings for regional language support.
  • 1 = vbSunday - Sunday (default)
  • 2 = vbMonday - Monday
  • 3 = vbTuesday - Tuesday
  • 4 = vbWednesday - Wednesday
  • 5 = vbThursday - Thursday
  • 6 = vbFriday - Friday
  • 7 = vbSaturday - Saturday

Example

Example 1

document.write(WeekdayName(3))

Output:

Tuesday

Example 2

D = #2007/10/1#
document.write(WeekdayName(Weekday(D)))

Output:

Monday

Example 3

D = #2007/10/1#
document.write(WeekdayName(Weekday(Date),true))

Output:

Monday or Mon