Javascript clock, to timezone,...

User 456980 Photo


Registered User
81 posts

Hi all,
Ok, what I need here, I have been working working on for quite some time, and have just about given up. I need a clock, on a webpage. In javascript, preferably, if not, I suppose that is ok. the main thing is that it needs to be set to a specific timezone (say, Port Moresby, PNG), and it needs to display correctly regardless of the client's clock... if their computer clock is wrong, this needs to still display correctly.

The ones I've been trying out, are set to specific timezones, on this page:
http://southpacificfamily.org/css%20tes … clock.html

the problem is that they change if I change my computer clock settings.

Any ideas?
Thanks
-MK
I work on my computer mainly for the purpose of working on my computer.
User 355448 Photo


Ambassador
3,144 posts

MK,

I think this is flash instead of javascript.

Look at http://www.worldtimeserver.com/ and you will see a clock displaying New York time. You can customize the color of the clock and set the timezone that will be displayed, and you can set the name of the city or whatever that will display below the clock (or remove the name).
User 456980 Photo


Registered User
81 posts

That clock looks great... but I just tested it by changing the time my computer is set to... and it throws that clock off, too!
Is there no clock that gets it's information from somewhere other than the client computer?
I work on my computer mainly for the purpose of working on my computer.
User 456980 Photo


Registered User
81 posts

I've been working on this today... and the only thing I have come up with is from timeanddate.com, they offer free clocks that do not depend on the client computer time.... the only problem is, to get them on you web page, what they have you do is create an iframe to one of their pages with your clock on it... which just seems a bit odd to me, but I guess I can go with it.
So the question I have: how did THEY do it? How did they get a clock that doesn't change if my computer is wrong?!
I work on my computer mainly for the purpose of working on my computer.
User 355448 Photo


Ambassador
3,144 posts

MK,

Did you put the clock on a web page and test it? It worked great, then you changed the time on your computer and the time on the web page changed.

Never fear. Refresh the page and it is correct even though your time on your computer is wrong. The web clock gets it time from chaosserver.com and will display the correct time.

1. put the clock back on the web page.
2. set your computer time to be wrong.
3. visit your web page and see the correct time.

Try it. It works for me.
User 456980 Photo


Registered User
81 posts

ah! henceforth I shall always refresh my page before drawing conclusions. *raises right hand*
Works perfectly. Thanks, Bill!
-MK
I work on my computer mainly for the purpose of working on my computer.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.