Weekday() returns a number for the day of the week. If you omit the optional first-day argument, Sunday is treated as day 1. WeekdayName() converts that number to a localized day name.
Weekday(#7/25/2006#)
The result is 3 because July 25, 2006 was a Tuesday when Sunday is day 1.
Weekday(d_mydate)
Weekday(#7/25/2006#)
WeekdayName(weekday[, abbreviate[, firstdayofweek]])
Response.Write WeekdayName(4)Returns the full localized name, such as Wednesday.
Response.Write WeekdayName(4, True)Returns an abbreviated name, such as Wed.
Response.Write WeekdayName(5, False)Returns the full day name, such as Thursday.
Dim d_mydate
d_mydate = Now
Response.Write WeekdayName(Weekday(d_mydate))
| Value | Day |
|---|---|
| 1 | Sunday |
| 2 | Monday |
| 3 | Tuesday |
| 4 | Wednesday |
| 5 | Thursday |
| 6 | Friday |
| 7 | Saturday |
firstdayofweek. Keep the same convention in Weekday() and WeekdayName() when you need custom week starts.Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.