Fri Sep 16, 2011 11:39 pm
<html>
<title>java script clock</title>
<head>
<script language="JavaScript">
<!--
function showClock()
{
var thetime=new Date();
var hoursCounter=thetime.getHours();
var minutesCounter=thetime.getMinutes();
var secondsCounter=thetime.getSeconds();
var dayCounter=thetime.getDay();
var monthCounter=thetime.getMonth();
var todayDate=thetime.getDate();
var yearCounter=thetime.getYear();
var AM_PM=" ";
if (hoursCounter>=12)
AM_PM="PM.";
else
AM_PM="AM.";
if (hoursCounter>=13)
hoursCounter-=12;
if (hoursCounter==0)
hoursCounter=12;
if (secondsCounter<10)
secondsCounter="0"+secondsCounter;
if (minutesCounter<10)
minutesCounter="0"+minutesCounter;
if (dayCounter==0)
dayCounter="SudayCounter";
if (dayCounter==1)
dayCounter="ModayCounter";
if (dayCounter==2)
dayCounter="Tuesday";
if (dayCounter==3)
dayCounter="Wednesday";
if (dayCounter==4)
dayCounter="Thursday";
if (dayCounter==5)
dayCounter="Friday";
if (dayCounter==6)
dayCounter="Saturday";
monthCounter+=1;
if (yearCounter<=99)
yearCounter= "19"+yearCounter;
if ((yearCounter>99) && (yearCounter<2000))
yearCounter+=1900;
document.getElementById("timediv").innerHTML=hoursCounter+": "+
minutesCounter+": "+secondsCounter+" "+AM_PM+" "+dayCounter+", "+monthCounter+"/"+todayDate+"/"+yearCounter;
// sleep for one second
setTimeout('showClock()',1000);
}
//-->
</script>
</head>
<body>
<table>
<tr>
<td>Time:</td><td><div id="timediv" /></td>
</tr>
</table>
<SCRIPT language="JavaScript">
<!--
showClock();
//-->
</SCRIPT>
</body>
</HTML>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.