Clock and Date Script


Script Demo:


Script Source Code:

<script language="javascript">

/////////////////////////////////////////////////////////////////////
//                                                                 //
//     YOU MAY USE THIS SCRIPT IF YOU LEAVE THIS MESSAGE UP.       //
//                                                                 //
//                 This Script Made By David Christy.              //
//                                                                 //
//                       webresource@usa.net                       //
//               http://www.cyberhighway.net/~jchristy/            //   
//                                                                 //
/////////////////////////////////////////////////////////////////////  


TMonth = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
TDay = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
TDate = new Date();
CurDay = TDate.getDay();
CurMonth = TDate.getMonth();
Month = TMonth[CurMonth];
Day = TDay[CurDay];
NDay = TDate.getDate();
CurYear = TDate.getYear();
Year = "19" + CurYear;

document.write("<table border=2><tr><td><center><h3>"+Day+", "+Month+" "+NDay+", "+Year+"</h3></center></td></tr>");

TTime = new Date();
CurMin  = TTime.getMinutes();
CurHour = TTime.getHours();

if(CurHour > "12"){
hour = CurHour - "12";
minutes = CurMin;
time = "P.M.";
}

else{
hour = CurHour;
minutes = CurMin;
time = "A.M."; 
}

if(CurMin < "10"){
minutes = "0" + CurMin;
}

document.write("<tr><td><h3><center>"+hour+":"+minutes+" "+time+"</center></h3></td></tr></table>");

</script>

Visit The Searcher at http://www.cyberhighway.net/~jchristy/.