Weekday() and WeekdayName() in Classic ASP

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.

Get a weekday number

Weekday(#7/25/2006#)

The result is 3 because July 25, 2006 was a Tuesday when Sunday is day 1.

Use a Date variable

Weekday(d_mydate)

The same fixed-date example

Weekday(#7/25/2006#)

WeekdayName() syntax

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.

Get today's weekday name

Dim d_mydate
d_mydate = Now
Response.Write WeekdayName(Weekday(d_mydate))

Default Weekday() values

ValueDay
1Sunday
2Monday
3Tuesday
4Wednesday
5Thursday
6Friday
7Saturday
First-day rule: the numeric meaning changes if you pass a different firstdayofweek. Keep the same convention in Weekday() and WeekdayName() when you need custom week starts.

ASP Home






✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer