Welcome to Geek Times!
spacer
TodaysDate (ASP)
Find on this site:


home
search
archive
about

.
A client likes having the date on their home page. Here's the ASP code we used. We later moved to using Borscht/Java, also on this site. A string of the form "Thursday 18 June 1998" is retrieved in the body of the ASP page by saying
<% =todaysDate %>
<%
'------------------------------------------------------------------
' get todays date
'------------------------------------------------------------------
weekArray = Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")

monthArray = Array("January","February","March","April","May","June","
July","August","September","October","November","December")

thArray = Array("st","nd","rd","th","th","th","th","th","th","th",
"th","th","th","th","th","th","th","th","th","th", "st",
"nd","rd","th","th","th","th","th","th","th","st")

Dim weekday, month, day, year
weekday = DatePart("w", date,1)
month = DatePart("m", date)
day = DatePart("d", date)
' year = DatePart("yyyy", date)
todaysDate = weekArray(weekday - 1) & ", " & monthArray(month -1) & " " & day & thArray(day - 1)
%>
This page is copyrighted 1993-2006 by Michael 'Mickey' Sattler, some rights reserved via the Creative Commons License. Questions and comments? Send email to the Geek Times Webmaster. (Domain and web content hosting at 1and1.)
email