
How to display the Visitors local time and date in a blog is one of the questions that php cannot answer (As it is a server side language).
To show your blog visitors local time and date ,we are going to use a simple 3 liner java script code.
So to display the local time of your users local time and date any where in your blog -copy paste the code snippet given below.
<SCRIPT>
document.write(Date()+".")
</SCRIPT>
Yeah that’s all you need for it to work.
What this code will do is take the time and local time zone of your blog visitors computer and displays it.
As you can see from the image ,this nifty little clock(just to say) of ours is without any design.
To give a nice look to this clock we will wrap this java script code inside a div named “clock”.
<div class="clock"> <SCRIPT> document.write(Date()+".") </SCRIPT> </div>
Now you can change the color of this date and time snippet to whatever you want and some more customizations as well.
Here is how time ,day and date would look without and customization
|
Related posts: |
![]() |












{ 2 comments… read them below or add one }
very nice post..
you save me man thanks!!!!