PDA

View Full Version : Displaying multiple live clocks on a page



HopiBuddha
01-29-2009, 01:01 PM
Anyone:

What would a javascript look like if I wanted to display 5 different live clocks (timezones) across the top of my web page?

With the zones being: Washington, DC; London; Berlin; Baghdad; Kabul

Any help with this would be greatly appreciated. I've found several scripts online in other areas, but I am looking for one that will display multiple text clocks (not analog) in a line as a header across the page.

Thanks!
HopiBuddha

Dirt_Diver
01-29-2009, 01:31 PM
http://www.dynamicdrive.com/dynamicindex6/clock2.htm

Use this script and just change the name of the onLoad


<body onLoad="show_clock(), show_clock2(), show_clock3(), show_clock4(), show_clock5()">

make sure you change the names in the .js files.

HopiBuddha
01-29-2009, 02:25 PM
Like this?

// The main part of the script:
function show_clock() {
if (old == "die") { return; }
function show_clock2() {
if (old == "die") { return; }
function show_clock3() {
if (old == "die") { return; }


I have a feeling I don't know enough about JavaScript; still can't get it to work.

Any ideas?
HopiBuddha

jscheuer1
01-29-2009, 03:32 PM
Neither the Dynamic Drive Live Clock script:

http://www.dynamicdrive.com/dynamicindex6/clock2.htm

nor the one from that other thread:

http://www.dynamicdrive.com/forums/showthread.php?t=131

can handle more than one clock.

You would need something like:

http://www.dynamicdrive.com/dynamicindex6/localtime.htm

which requires that you have a server side language available to you on your host (like PHP or asp, etc.) in order to get the server time. Do you have that?

HopiBuddha
01-30-2009, 09:56 AM
No I don't have either php or ASP enabled on the webserver, and cannot do it since I am not in charge of it. I've tried this script also and talked with the web server admin's to see if they would change through IIS but they won't...not sure why. Do you know of any other script that could possibly get the clocks operational?

hopibuddha