var cDt=new Date();
if (cDt.getHours() > 18)
document.write ("Buona sera ")
if ((cDt.getHours() > 12) &  (cDt.getHours() < 18))
document.write ("Buon pomeriggio ")
if (cDt.getHours() < 12)
document.write ("Buongiorno ")