Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

VBScript Weekday Function

VBScript Weekday Function


VBScript reference manual Complete VBScript Reference Manual


The Weekday function returns a number representing the day of the week, between 1 and 7.

Syntax

Weekday(date[,firstdayofweek])

Parameters Description
date Required. The date expression to be evaluated.
firstdayofweek Optional. Specifies the first day of the week.

The following values can be used:

  • 0 = vbUseSystemDayOfWeek - use the Regional Language Support (NLS) API setting
  • 1 = vbSunday - Sunday (default)
  • 2 = vbMonday - Monday
  • 3 = vbTuesday - Tuesday
  • 4 = vbWednesday - Wednesday
  • 5 = vbThursday - Thursday
  • 6 = vbFriday - Friday
  • 7 = vbSaturday - Saturday
  • |

    Example

    Example

    The example above produces the following output:

    document.write(Weekday("2010-02-16",0) & "

    ") 3

    2

    1

    7

    6

    5

    Try it »


    VBScript reference manual Complete VBScript Reference Manual