var time = new Date();
var str;
if(time.getHours()<6)  str="凌晨好!"
if((time.getHours()>=6)&&(time.getHours()<9))  str="早晨好!"
if((time.getHours()>=9)&&(time.getHours()<12)) str="上午好!"
if((time.getHours()>=12)&&(time.getHours()<14)) str="中午好!"
if((time.getHours()>=14)&&(time.getHours()<18)) str="下午好!"
if((time.getHours()>=18)&&(time.getHours()<20)) str="傍晚好!"
if((time.getHours()>=20)&&(time.getHours()<23)) str="晚上好!"
document.write(str);