prova cosi':
codice:
<head>
<script language="JavaScript">
function todaytime(){
var months=new Array(13);
months[1] = "Gennaio";
months[2] = "Febbraio";
months[3] = "Marzo";
months[4] = "Aprile";
months[5] = "Maggio";
months[6] = "Giugno";
months[7] = "Luglio";
months[8] = "Agosto";
months[9] = "Settembre";
months[10] = "Ottobre";
months[11] = "Novembre";
months[12] = "Dicembre";
var dateObj=new Date()
var lmonth=months[dateObj.getMonth() + 1]
var date=dateObj.getDate()
var ora=new Date();
var ore = ora.getHours();
var minuti = ora.getMinutes();
var secondi= ora.getSeconds();
var anno = ora.getFullYear();
if
(minuti<10) minuti="0" + ora.getMinutes();
else
minuti=ora.getMinutes();
if
(secondi<10) secondi="0" + ora.getSeconds();
else
secondi=ora.getSeconds();
document.getElementById('timer').innerHTML=ore + ":" + minuti + " - " + date + " " + lmonth + " " + anno;
window.setTimeout('todaytime()',1000);
}
</script>
</head>
da avviare cosi':
codice:
<body onload="todaytime();">
questo invece mettilo dove vuoi far apparire la data:
codice:
<div id="timer"></div>
ciao