 today=new Date();
 function initArray(){
   this.length=initArray.arguments.length
   for(var i=0;i<this.length;i++)
   this[i+1]=initArray.arguments[i]  }
   var d=new initArray(
     "星期日",
     "星期一",
     "星期二",
     "星期三",
     "星期四",
     "星期五",
     "星期六");
document.write(
     "<font color=#ff0000 style='font-size:12pt;font-weight: bold;font-family: 宋体'> ",
     today.getYear(),"年",
     today.getMonth()+1,"月",
     today.getDate(),"日",
     "</font><br><br>" );
document.write(
     "<font color=#FF0000 style='font-size:12pt;font-weight: bold;font-family: 宋体'> ",
     d[today.getDay()+1],
     "</font><br><br>" );
now = new Date(),hour = now.getHours()
if(hour < 6){document.write("<font color=#ff0000 style='font-size:12pt;font-weight: bold;font-family: 宋体'> ","早上好!")}
else if (hour < 8){document.write("<font color=#ff0000 style='font-size:12pt;font-weight: bold;font-family: 宋体'> ","全新的一天!")}
else if (hour < 12){document.write("<font color=#ff0000 style='font-size:12pt;font-weight: bold;font-family: 宋体'> ","早安!")}
else if (hour < 14){document.write("<font color=#ff0000 style='font-size:12pt;font-weight: bold;font-family: 宋体'> ","午安")}
else if (hour < 18){document.write("<font color=#ff0000 style='font-size:12pt;font-weight: bold;font-family: 宋体'> ","午安!")}
else if (hour < 22){document.write("<font color=#ff0000 style='font-size:12pt;font-weight: bold;font-family: 宋体'> ","晚上好!")}
else if (hour < 24){document.write("<font color=#ff0000 style='font-size:12pt;font-weight: bold;font-family: 宋体'> ","晚上好!")}