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!
}