Display Visitors Local Time And Date And Time In Wordpress blog

by furhead on February 18, 2010


Javascript to display local daye and time.jpg

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

Disaply date and time wordpress blog

Related posts:

  1. Welcome Blog visitors with WP-Greet-Box Wordpress Plugin
  2. Hiding Sub Categories to Display on Wordpress
  3. How to Add Youtube Video To Wordpress blog and resize it
  4. Adding Google Analytic to Wordpress blog With Thesis Theme
  5. Improve Performance by Image Caching of Wordpress Blog using htaccess trick

WooThemes - WordPress themes for everyone

{ 2 comments… read them below or add one }

sudharsan @ technoskillonline February 19, 2010 at 8:14 pm

very nice post..

Reply

Rafael March 30, 2010 at 9:13 am

you save me man thanks!!!!

Reply

Leave a Comment

Previous post:

Next post:

.