GIORNO MESE E ANNO CORRENTE + MESSAGGIO A SECONDA DELL'ORA

« Older   Newer »
  Share  
tottiff
view post Posted on 12/12/2009, 16:16




Si avrà un datario grafico con la data corrente, più un messaggio che varia a seconda dell'ora.
Inserire dove si vuole in ->Gestione codice html
HTML
<script language="JavaScript" type="text/javascript">
var Today=new Date();
var ThisDay=Today.getDay();
var ThisDate=Today.getDate();
var ThisMonth=Today.getMonth()+1;
var ThisYear=Today.getFullYear(); //included if you wish to insert the year
function DayTxt (DayNumber) {
var Day=new Array();
Day[0]="Domenica";
Day[1]="Lunedì";
Day[2]="Martedì";
Day[3]="Mercoledì";
Day[4]="Giovedì";
Day[5]="Venerdì";
Day[6]="Sabato";
return Day[DayNumber];
}
var DayName=DayTxt(ThisDay);
function MonthTxt (MonthNumber) {
var Month=new Array();
Month[1]="Gennaio";
Month[2]="Febbraio";
Month[3]="Marzo";
Month[4]="Aprile";
Month[5]="Maggio";
Month[6]="Giugno";
Month[7]="Luglio";
Month[8]="Agosto";
Month[9]="Settembre";
Month[10]="Ottobre";
Month[11]="Novembre";
Month[12]="Dicembre";
return Month[MonthNumber];
}
var MonthName=MonthTxt(ThisMonth);
var d = new Date();
var h = d.getHours();
document.write("<table border='3' bgcolor='white' width='70' height='85' align='left'>"+"<td>"+"<p align='center'>"+"<font size='-2'>"+DayName+"
"+"<font color='orangered' size='+3' >"+ThisDate+"<\/font>"+"
"+MonthName+"
"+ThisYear+"<\/b>"+"<\/font>"+"<\/p>"+"<\/td>"+"<\/tr>"+"<\/table>

");
if (h < 2) document.write("<p align='center'>"+"<b>"+"Buon Giorno! Si, è appena passata la mezzanotte."+"<\/b>"+"<\/p>");
else if (h < 3) document.write("<p align='center'>"+"<b>"+"Buon Giorno! Alzato presto o al lavoro tardi?"+"<\/b>"+"<\/p>");
else if (h < 7) document.write("<p align='center'>"+"<b>"+"Buon Giorno! Sei mattiniero !"+"<\/b>"+"<\/P>");
else if (h < 12) document.write("<p align='center'>"+"<b>"+"Buon Giorno!"+"<\/b>"+"<\/P>");
else if (h < 17) document.write("<p align='center'>"+"<b>"+"Buon Pomeriggio!"+"<\/b>"+"<\/P>");
else if (h < 23) document.write("<p align='center'>"+"<b>"+"Buona Sera!"+"<\/b>"+"<\/P>");
else document.write("<p align='center'>"+"<b>"+"Buona Notte! Non vai a dormire ?"+"<\/b>"+"<\/p>");
</script>
 
Top
M3PH1ST076E
view post Posted on 12/12/2009, 17:52




bello
 
Top
1 replies since 12/12/2009, 16:16   42 views
  Share