`

A clock with images

In this example we will create a clock which displays the time using images , sounds impossible well stay tuned its really quite simple .

The digits for this clock was found at http://www.counterart.com , these are available as zip files so we download them and then unzip them in our image directory into their own folders. This example was originally used in our graphic counter .

Code :

<%
'our variables
Dim dtmDate , dtmHour , dtmMinute , dtmSecond
'store the system time in dtmDate
dtmDate = Now()
'now extract the hours
dtmHour = Hour(dtmDate)
'now extract the minutes
dtmMinute = Minute(dtmDate)
'now extract the seconds
dtmSecond = Second(dtmDate)
%>
<%
For i = 1 to Len(dtmHour)
Response.Write "<img src=""images/1/" & Mid(dtmHour, i, 1) & ".gif" & """>"
Next
Response.Write ":"
%>
<%
For i = 1 to Len(dtmMinute)
Response.Write "<img src=""images/1/" & Mid(dtmMinute, i, 1) & ".gif" & """>"
Next
Response.Write ":"
%>
<%
For i = 1 to Len(dtmSecond)
Response.Write "<img src=""images/1/" & Mid(dtmSecond, i, 1) & ".gif" & """>"
Next
Response.Write ":"
%>

 

Books

cover

Professional Active Server Pages 3.0

cover

Beginning ASP Databases

cover

ASP in a Nutshell: A Desktop Quick...