ASP 101 - Active Server Pages 101 - Web04
The Place ASP Developers Go!

Please visit our partners


Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash



 Top ASP 101 Stories Top ASP 101 Stories
Getting Scripts to Run on a Schedule
The Top 10 ASP Links @ Microsoft.com
What is Adovbs.inc and Why Do I Need It?

QUICK TIP:
Scriptless ASP Pages
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates


Quick Tips


What Day of the Week Is That?

Have you ever needed to know what day of the week a given date falls on? Whether you use this knowledge simply for planning your vacations (as I do) or you've got a more noble use in mind, it's a piece of information that can be pretty handy.

To find the day of the week that a given date falls on, you can use the Weekday function built into VBScript:

<%= Weekday(#July 4, 2002#) %>

The above will return the value 5 since the date specfied falls on a Thursday and Thursday is the 5th day of the week. From here you could easily write a function to take this value and return the name of the day, but there's no need to... VBScript will do it for you. If you want VBScript to return the name of the day and not just a number, you just use the WeekdayName function to convert the number into the appropriate name:

<%= WeekdayName(Weekday(#July 4, 2002#)) %>

The line above will return Thursday. Supplying the optional parameter for Abbreviate and setting it to True (as illustrated below) will return an abbreviated version.

<%= WeekdayName(Weekday(#July 4, 2002#), True) %>

Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to: webmaster@asp101.com.


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers