5 October 2017

How to Add Current Date and Time to Website Using JavaScript

Adding date and time to your web page is a nice thing to do since users doesn’t necessarily have to exit your page in order to check the date and time (although, they don’t necessarily have to leave your page in order to know the date and time since it is most probably displayed at the bottom right corner of every windows task bar). I want to believe that you must have seen this in some web pages and want to include it in your own page which is why you are viewing this.

There are so many ways via which one can achieve this but the method I want to show you requires just adding a simple JavaScript code to each of the pages you want the date and time appearing. All you need to do is copy the code snippet below and paste anywhere in your pages where you want the date and time to appear.

<script type="text/javascript">
document.write("" + Date() );
</script>

Good thing is that by adding the above simple JavaScript code to your web page, you get to display not only the date and time but also the time zone which you are in.
Share:

0 comments:

Post a Comment

IMPORTANT INFORMATION

Please do bear in mind that any Comment left on this Blog that is in no way related to the post under which it is being left, will not be accepted and so won’t be published. For any such unrelated question and enquiries, please use the Contact Us section to get in touch with us and we promise to get back to you 30 minutes after we get your message.

Popular Posts

Like us on Facebook
Follow us on Twitter
Recommend us on Google Plus
Subscribe me on RSS