dat = new Date() ng=dat.getDate() //come 25 gg=ng+"/"+(dat.getMonth()+1) //come 25/3 nm=(dat.getMonth()+1) //come 3 var mm = new Array(12); mm[1]="gennaio";mm[2]="febbraio";mm[3]="marzo";mm[4]="aprile";mm[5]="maggio";mm[6]="giugno";mm[7]="luglio";mm[8]="agosto";mm[9]="settembre";mm[10]="ottobre";mm[11]="novembre";mm[12]="dicembre"; ggg = new Array(7) ggg[0]="domenica";ggg[1]="lunedì";ggg[2]="martedì";ggg[3]="mercoledì";ggg[4]="giovedì";ggg[5]="venerdì";ggg[6]="sabato"; gggg=(ggg[dat.getDay()]) //come sabato mmm = mm[dat.getMonth() + 1] //come marzo aaa = dat.getYear() //come 2000 hh=(dat.getHours()+100).toString().substring(1,3); min=(dat.getMinutes()+100).toString().substring(1,3) sec=(dat.getSeconds()+100).toString().substring(1,3) function dw(a){document.write(a)} dc = (gggg+" " +ng+ " " +mmm+" "+aaa+ " ore " + hh + ":"+min+":"+ sec); if (hh >=00 && hh < 08) {dw("Buona notte ") } if (hh>=08 && hh <= 12) {dw("Buon giorno ") }if (hh>=13 && hh<= 19) {dw("Buon pomeriggio")} if (hh>19) {dw("Buona sera ") } if (hh>=02 && hh<= 07) {dw("Questa è l'ora di dormire! ")} dw(" oggi è "+dc+"")