VBScript Weekday Function
Definition and Usage
The Weekday function can return a number representing the day of the week, ranging from 1 to 7.
Note:
Syntax
Weekday(date[,firstdayofweek])
Parameter | Description |
---|---|
date | Required. The date expression to be calculated. |
firstdayofweek |
Optional. Specifies the first day of the week. The following values can be used:
|
Instance
Example 1
D = #10/1/2007# document.write(Weekday(D)) 'October 1, 2007 was a Monday, the second day of the week.'
Output:
2