Full version: jsB@nk » Snippet » Time Greeting
URL: https://www.javascriptbank.com/time-greeting.html
Don't just welcome your visitors anymore, JavaScript can write good morning, good evening, or good afternoon based on the time the page was loaded, according to the user's system clock. Neat!
Full version: jsB@nk » Snippet » Time Greeting
URL: https://www.javascriptbank.com/time-greeting.html
<SCRIPT language=JavaScript><!--Begindatetoday = new Date();timenow=datetoday.getTime();datetoday.setTime(timenow);thehour = datetoday.getHours();if (thehour > 18) display = "Evening";else if (thehour >12) display = "Afternoon";else display = "Morning";var greeting = ("Good " + display + "!");document.write(greeting);// End --></SCRIPT><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->