Results 1 to 3 of 3

Thread: Help With Time Offset and Dynamic Countdown Script

  1. #1
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Help With Time Offset and Dynamic Countdown Script

    1) Script Title: Dynamic Countdown Script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...dhtmlcount.htm

    3) Describe problem:

    I am currently running this script on a website creating various countdown timers for actions. I've written my scripts in php. The problem I'm running into is that my server clock is set to CST (GMT -6) and people are using my site from various locations around the world so the timers are really only working correctly for people who have their system clocks set to CST.

    For example, if the timer is supposed to count down to 5 minutes from "x" time, people whose time is EST are seeing their timer display 65 minutes instead of 5 minutes. Is there a way to adjust for this offset via JS or a combination of PHP/JS without having them declare their locale via the PHP scripts? I've seen scripts using getoffset() (I think that's what it is) but I can't seem to figure out how to do this with this particular script.

    From what i understand, the Universal Countdown Script http://www.dynamicdrive.com/dynamici...lcountdown.htm can adjust for offset time, but for the life of me (I'm JS dumb) I can't figure out how to adjust the script in question to work like the universal Countdown Script.

    Any help would be much appreciated on this.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Universal Countdown script is what you'll want to use actually. Using JavaScript alone to calculate timezone offsets isn't reliable (at least I haven't found a consistent technique), hence the later script was created, which relies on either SSI, PHP, ASP, or frankly any serve side feature to get the time of the server and use that as the basis.
    DD Admin

  3. #3
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks, that does exactly what I want without having to make many changes on my end with my pre-existing system. Thanks again.

Bookmarks

Posting Permissions

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