Display the date graphically

This example shows how to display todays date graphically this is quite a neat little effect you may wish to use . The digits are courtesy of http://www.counterart.com which has an excellent range of counter images .

You van download the gifs for this example here

Code :

<%
'declare our variables
Dim dtmDate , dtmDay , dtmMonth , dtmYear
'store system date as dtmDate
dtmDate = Now()
'store the day as dtmDay
dtmDay = Day(dtmDate)
'store the month as dtmMonth
dtmMonth = Month(dtmDate)
'store the year as dtmYear
dtmYear = Year(dtmDate)
%>
<%
'display the day
For i = 1 to Len(dtmDay)
'this is the path to the images , the images are numbered from 0 to 9 and stored
'in the images directory in a folder called 3 if your images are
'different then you will have to modify the path below
Response.Write "<img src=""images/3/" & Mid(dtmDay, i, 1) & ".gif" & """>"
Next
Response.Write "<img src ='images/3/colon.gif'>"
%>

<%
'display the month
For i = 1 to Len(dtmMonth)
'this is the path to the images , the images are numbered from 0 to 9 and stored
'in the images directory in a folder called 3 if your images are
'different then you will have to modify the path below
Response.Write "<img src=""images/3/" & Mid(dtmMonth, i, 1) & ".gif" & """>"
Next
Response.Write "<img src ='images/3/colon.gif'>"
%>
<%
'display the year
For i = 1 to Len(dtmYear)
'this is the path to the images , the images are numbered from 0 to 9 and stored
'in the images directory in a folder called 3 if your images are
'different then you will have to modify the path below
Response.Write "<img src=""images/3/" & Mid(dtmYear, i, 1) & ".gif" & """>"
Next
%>

 

Sponsors