Return the day of the week.
Syntax
Weekday(Date [,FirstDayofWeek])
Key
Date A date expression
FirstDayofWeek An integer for the first day of the week
Example
result = Weekday(#Mar/6/2010#) WScript.Echo result > 7 Weekday will return one of the following constant values: vbSunday 1 vbMonday 2 vbTuesday 3 vbWednesday 4 vbThursday 5 vbFriday 6 vbSaturday 7
“Write it on your heart that every day is the best day in the year” - Ralph Waldo Emerson
Related:
DateAdd - Add a time interval to a Date
DateDiff - Return the time interval between two dates
DatePart - Return a unit of time from a date
WeekdayName - Return the named day of the week
Equivalent Powershell command: (Get-Date).DayOfWeek.Value__ + 1 (The underscores give a number and the +1 is because PS counts from 0)