Codefixer - ASP tutorials, resources and software
ASP.NET 3.5/2.0 Hosting – Click Here
Home   Articles   Resources   ASP directory   ASP Tutorials   Code Snippets   ASP Applications   Forum
Tuesday 13 May
MembersPro PayPal - ASP Membership software

asp.netPRO “Best ASP.NET Host” – DiscountASP.NET


ASP Partner ASP Partner ASP Partner more partners...

Displaying the Day and the Date

As you can see just below our navigation bar on the far right is the current day and date of our server. Below is the ASP(VBScript) code that produces this. Just copy and paste this into your page.

<%
Dim strDay
Dim strMonth
strDay=(weekday(date))
Select Case strDay
case 1 Response.write("Sunday")
case 2 Response.write("Monday")
case 3 Response.write("Tuesday")
case 4 Response.write("Wednesday")
case 5 Response.write("Thursday")
case 6 Response.write("Friday")
case 7 Response.write("Saturday")
End Select
Response.Write(" "&day(date)&" ")

strMonth=(month(date))
Select Case strMonth
case 1 Response.write("January")
case 2 Response.write("February")
case 3 Response.write("March")
case 4 Response.write("April")
case 5 Response.write("May")
case 6 Response.write("June")
case 7 Response.write("July")
case 8 Response.write("August")
case 9 Response.write("September")
case 10 Response.write("October")
case 11 Response.write("November")
case 12 Response.write("December")
End Select
%>

Other date and time related tutorials:
Read more on the Date, Time and Now VBScript functions
Here's a code snippet to display the day and date with the ordinal suffix (eg. Mon 25th December).
How to get the current month name
Display the dates and times
Time and Date based greetings
IsDate Function
The DateDiff DateAdd and DatePart Functions

LinksPro - Directory  and Link  Management Software




ASP.NET 3.5/2.0 Web Hosting: 3 Months FREE – Click Here!




About | Contact | Advertise | Feedback | Hire Us | Link

Site developed by Michael Wall - Web Design Belfast N.Ireland.
Copyright © 2000-2008. All rights reserved.

Do you intend to move to ASP.NET or have you already?
Yes will do
Have done
ASP does fine
Not a priority


Directory Software