var date=new Date(); // Gets the full date!
var hour=date.getHours(); // Gets the hours!
                        
if(hour<=11) {
document.write('Good morning, '); // If it's before 12 PM then display this!
} else if(hour<18){
document.write('Good afternoon, '); // After 12 PM display this!
} else {
document.write('Good evening, '); // After 6 PM display this!
}