JS, for instance, provides access to the Date class.
let timeNow = new Date();
console.log(timeNow.getHours() + ":" + timeNow.getMinutes())
From here, you deduce your greetings accordingly using conditional statements.
Shashank Reddy Voorelli
You can also use the "Triggers" for any live event listener. Jquery has an api for triggers which can easily be used