Displaying Author Local Time
1. Introduction and Sample
Join the Discussion
More of this Feature
Have you ever thought how useful it might be to display your local time on your web site so that visitors to your site will know what time it is where you are? If you have a site where you expect to interact with the visitors then you may have.
There are three computers involved in getting the information transferred from you to the visitors to your web site. There is your computer that you work on to create the web pages, there is the server where the pages are stored, and there is the visitor's computer that they use to view the pages.
You can place scripts in your page that run on the visitor's computer and you can run programs from the server. Nothing that you place in your web page can access any information from your computer.
Given this, you might think that arranging to display your local time on the page for your visitor to see it might be impossible. Not so as you can see from the time displayed below. In this instance, my computer is located in Australia, the server is in America and your computer is located wherever in the world that you are.
The script that displays the time actually runs on your computer and relys on your having your timezone and local time set correctly in order to calculate what the time is at my location.
So let's Get the Script and then we can look at what we need to do to customize it for your timezone.
Note that the script and the descriptions of the functions that it contains are rewritten from the "Ask Felgall" website with the permission of the copyright owner.

