DIGITAL CLOCK and DATE SCRIPT.


This html script will give your web page a digital clock and date, an example of this is above. All you have to do to get the digital clock is copy and paste the script below on to your web page


This part of the script goes out side the <HEAD> tag.

<script language="JavaScript">
<!-- Hide from older browsers
var timerID = null
var timerRunning = false
function MakeArray(size)
{
this.length = size;
for(var i = 1; i <= size; i++)
{
this[i] = "";
}
return this;
}
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false
}
function showtime () {
var now = new Date();
var year = now.getYear();
var month = now.getMonth() + 1;
var date = now.getDate();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var day = now.getDay();
Day = new MakeArray(7);
Day[0]="SUNDAY";
Day[1]="MONDAY";
Day[2]="TUESDAY";
Day[3]="WEDNESDAY";
Day[4]="THURSDAY";
Day[5]="FRIDAY";
Day[6]="SATURDAY";
var timeValue = "";
timeValue += (Day[day]) + " ";
timeValue += ((month > 10) ? " 0" : " ") + month + "-";
timeValue += date + "-" + year + " ";
timeValue += ((hours <= 12) ? hours : hours - 12);
timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
timeValue += (hours < 12) ? " AM" : " PM";
document.craig.face.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true
}
function startclock () {
stopclock();
showtime()
}
// End Hide -->

</SCRIPT>>

Copy this script inside your body tag:

onLoad="startclock();"

Copy this script to wherever on your page you wish the clock to appear:

<center><FORM NAME='craig'> <INPUT TYPE=text NAME='face' size=35 value=''> </FORM></center>

There is nothing to configure on this script. Insert the entire script wherever you wish to have the clock show on the document.


List of Craig's html scripts.
mouseover images | break out of frames | auto page changer | email links | text mouseover |
digital clock | text scroll | sound waves | pop up mouseover | button pop up |
button mouseover | statas scroll |
Animated images.
cartoons | bars | people | animals | icons |
buttons | words | miscellous |
None animated images.
back grounds | sound clips | Downloads |
Home Page | South Park Page |