SUBSCRIBE OUR YOUTUBE CHANNEL 👉
Join in Google News
If You Want Adsense Approval for your blog Contact Us Adsense Ready theme Now!

Make good morning, afternoon and evening greetings on the realtime website

 












Hi Web Developers! back again with the tech teacher. this time the tech teacher will share Tutorials on how to make greetings good morning, afternoon, evening, and night on your website, for masters and the like, please correct if something is not quite right, but I don't think there is and for newbies who need enlightenment please follow and practice.


All right, so that you are more confident and satisfied with this blog, I will guess when you read this article. and it turns out that this blog knows that you are reading this article at night right?

Now, I believe and I'm satisfied if the greetings for good morning, afternoon, evening and tonight follow the time around.

How to make?

<script>
//<![DATA[
var h=(new Date()).getHours();
var m=(new Date()).getMinutes();
var s=(new Date()).getSeconds();
if (h >= 4 && h < 10) document.writeln("Good morning,");
if (h >= 10 && h < 15) document.writeln("Good afternoon,");
if (h >= 15 && h < 18) document.writeln("Good evening,");
if (h >= 18 || h < 4) document.writeln("Good night,");
//]]>
</script>

Then you can continue writing after the closing script, </script>

Ok.that's all, that's how to make good morning, afternoon and evening greetings on a realtime website, don't forget to share with other friends. So hopefully it's useful, thank you.

Post a Comment