Это скрипты часов, их вы можете поставить в любом месте вашего сайта
Время:
<html>
<head>
<title>Время.</title>
<script language="JavaScript">
<!--
ndata = new Date();
hours = ndata.getHours();
mins = ndata.getMinutes();
secs = ndata.getSeconds();
if (hours < 10) {hours = "0" + hours }
if (mins < 10) {mins = "0" + mins }
if (secs < 10) {secs = "0" + secs }
datastr = ( hours + ":" + mins + ":"+secs )
-->
</script>
</head>
<body>
<font face="Arial" size="3" color="#b00000">
<script language="JavaScript">
<!--
document.write(datastr);
-->
</script>
</font>
</body>
</html>
Часы в заголовке окна:
<html>
<head>
<title>Часы в заголовке окна</title>
<script language="JavaScript">
timestr = "00:00:00";
tid = 0;
pause = 0;
var to;
var bcount;
var tcount;
function writer(){
document.write("test");
}
function time(n) {
tid=window.setTimeout("time(1)",to);
today = new Date()
if(today.getMinutes() < 10){
pad = "0"}
else
pad = "";
if(today.getSeconds() < 10){
pads = "0"}
else
pads = "";
timestr=today.getHours()+":"+pad+today.getMinutes()+":"+pads+today.getSeconds();
document.title = timestr;
window.clearTimeout(tid);
tid=window.setTimeout("time()",to);
}
function start(x) {
f=x;
to=60;
time(x);
}
function cleartids() {
window.clearTimeout(tid);
}
</script>
</head>
<body onload="start(document.forms[0])" onunload="cleartids()">
</body>
</html>
Время на страничке:
<html>
<head>
<title>Время на страничке!</title>
<script language="JavaScript">
function person_in() {
enter=new Date();
}
function person_out() {
exit=new Date();
time_dif=(exit.getTime()-enter.getTime())/1000;
time_dif=Math.round(time_dif);
alert ("Вы были здесь " + time_dif + " секунд!")
}
</script>
</head>
<body onload="person_in()" onunload="person_out()">
</body>
</html>
Часы в бегущей строке:
<head>
<title>Часики в бегущей строке</title>
</head>
<script LANGUAGE="javascript">
var id
var position=0
var numofloop=10
function banner() {
var nor = new Date()
var minutes = nor.getMinutes()
var hours = nor.getHours()
var seconds = nor.getSeconds()
var nortime = "В мнастоящий момент "
nortime += ((hours > 12) ? hours - 12 : hours)
nortime += ((minutes < 10) ? ":0" : ":") + minutes
nortime += ((seconds < 10) ? ":0" : ":") + seconds
nortime += (hours >= 12) ? " после полудня" : " до полудня"
var msg=" А знаете сколько сейчас времени? " + nortime + " ";
var pace=10;
document.form.banner.value=msg.substring(position,position+75) ;
if (position++==msg.length) {
if (numofloop-- < 2) return;
position=0;
}
id=setTimeout ("banner()", 1000/pace);
}
</script>
<body onload="banner()">
<form name="form">
<input type="text" name="banner" size="40">
</form>
</body>
</html>