Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Clocks in PHP

  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Thanked 0 Times in 0 Posts

    Clocks in PHP

    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!


  2. #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Denver, Colorado USA
    Thanked 511 Times in 499 Posts
    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.
    Finding out HOW to do something is called research, i.e. keep searching until you find the answer. After you attempt to do something and cannot solve a problem with it yourself, would be when you ask others for help.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts