View Full Version : Clocks in PHP

06-07-2007, 08:43 PM
I'd like to figure out how I can make a clock on my webpage, that shows an analog clock. Could be javascript. But I'd like to have a drop down or radio button menu of time-zone selections. So that the person viewing the site can select their timezone. But I also want it to save that timezone the next time that person goes to the website again. So if you wanted a Japanese timezone, you select it. Next time you go back to the site, it still reads the Japanese timezone.

Any help will be appreciated!


06-07-2007, 10:09 PM
The only way to have a smooth dynamic analog real time clock on a web page is to use javascript to display it. Here is a link that contains some sample scripts - http://www.dynamicdrive.com/dynamicindex6/index.html

For most of what you want, the easiest way would be to code the javascript clock script so that it used an initial starting time value that you supply instead of using the browser's local time.

The rest of what you want is simple HTML form code.

Store the time zone they select in a cookie to allow them to leave your site and return later.