Questo script indica l'ora ed anche un messaggio di benvenuto, e leggendo l'ora del vs computer lo aggiorna secondo per secondo, dandovi anche giorno mese anno.

Questo è lo script da inserire in html:

<SCRIPT LANGUAGE="JavaScript">

if (navigator.appName == "Microsoft Internet Explorer") {

ID = setTimeout("Aggiorn();",1000);

function Aggiorn() {

Mesi = new Array(11);

Mesi [0] = "Gennaio"

Mesi [1] = "Febbraio"

Mesi [2] = "Marzo"

Mesi [3] = "Aprile"

Mesi [4] = "Maggio"

Mesi [5] = "Giugno"

Mesi [6] = "Luglio"

Mesi [7] = "Agosto"

Mesi [8] = "Settembre"

Mesi [9] = "Ottobre"

Mesi [10] = "Novembre"

Mesi [11] = "Dicembre"

Data = new Date()

Giorno = Data.getDate()

Mese = Data.getMonth()

Anno = Data.getYear()

Datario = Data.toGMTString()

GiorSet = Datario.substring(0, 3)

if (GiorSet == "Sun") GiorSet = "Domenica"

if (GiorSet == "Mon") GiorSet = "Lunedì"

if (GiorSet == "Tue") GiorSet = "Martedì"

if (GiorSet == "Wed") GiorSet = "Mercoledì"

if (GiorSet == "Thu") GiorSet = "Giovedì"

if (GiorSet == "Fri") GiorSet = "Venerdì"

if (GiorSet == "Sat") GiorSet = "Sabato"

Ore = Data.getHours()

Minuti = Data.getMinutes()

Secondi = Data.getSeconds()

if ((Ore > 6) && (Ore < 13)) Saluto = "Buongiorno"

if ((Ore > 12) && (Ore < 18)) Saluto = "Buon pomeriggio"

if ((Ore > 17) && (Ore < 22)) Saluto = "Buona sera"

if (Ore > 21) Saluto = "Buona notte"

if (Ore < 7) Saluto = "Buona notte"

if (Minuti < 10) Minuti = "0" + Minuti

if (Secondi < 10) Secondi = "0" + Secondi

Cal = Saluto + ", sono le ore " + Ore + ":" + Minuti + "." + Secondi + " di " + GiorSet + ", " + Giorno + " " + Mesi[Mese] + " " + Anno

// document.FormData.Tes.value=Cal

ID = setTimeout("Aggiorn();",1000);

if (document.all)

document.all.clock.innerHTML=Cal

else

document.write(Orologio)

}

}

</script>

<span id="clock"></span>

<b>

</script>

 

ALTRI DATARI