Click to See Complete Forum and Search --> : World Clock script help?


goalie
03-18-2003, 08:17 AM
The clocks found here are GREAT, but how do I make them horizontal instead of vertical?

http://javascript.internet.com/clocks/world-clock.html

Thanks!

Also, is there a way to make the boxes around the actual time disappear (borders set to zero?)?

THanks and pls email me if you can help

jamie@scgonline.net

cyberade
03-18-2003, 10:04 AM
The answer to both problems would be to place all the times in a table.

khaki
03-18-2003, 10:17 AM
cyberade wrote: The answer to both problems would be to place all the times in a table.Yeah... that's pretty much it.
The only thing causing the clocks to be vertical was the <br> tags anyway.
Just lay it out with your own HTML design and you are all set.

in need of a <br>...
k

JamesMitchell
10-15-2003, 04:50 AM
I tried this script. The time is an hour out (I'm assuming it's a BST thing) Is there any way round this that won't muck it all up when the clocks change again?

JamesMitchell
10-15-2003, 05:10 AM
I have adapted the code for the time zones I want. However, I still have the BST problem. I realise it displays GMT and it tries to do something with BST. How would I get it to display, for example, the actual time in London?

<html>
<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Emanuel Gavrilv (eltal@sprint.ca) -->
<!-- Web Site: http://www.angelfire.com/on/eltal -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function GetTime() {
var dt = new Date();
var def = dt.getTimezoneOffset()/60;
var gmt = (dt.getHours() + def);
document.clock.local.value = (IfZero(dt.getHours()) + ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds()));
var ending = ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds());
var rome =check24(((gmt + 1) > 24) ? ((gmt + 1) - 24) : (gmt + 1));
document.clock.rome.value = (IfZero(rome) + ending);
var ho =check24(((gmt + 8) > 24) ? ((gmt + 8) - 24) : (gmt + 8));
document.clock.ho.value = (IfZero(ho) + ending);
var _GMT =check24(((gmt) > 24) ? ((gmt) - 24) : (gmt));
document.clock._GMT.value = (IfZero(_GMT) + ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds()));
var atl =check24(((gmt + (24-4)) > 24) ? ((gmt + (24-4)) - 24) : (gmt + (24-4)));
document.clock.atl.value = (IfZero(atl) + ending);
setTimeout("GetTime()", 1000);
}
function IfZero(num) {
return ((num <= 9) ? ("0" + num) : num);
}
function check24(hour) {
return (hour >= 24) ? hour - 24 : hour;
}
// End -->
</script>
</HEAD>


<BODY onLoad="javascript:GetTime();">
<center>
<form name="clock">
<strong>Local Time <input type="text" size="8" name="local"></strong>
<p>
Atlantic Time (GMT-4) <input type="text" size="8" name="atl">
<p>
<strong>Greenwich Mean Time (GMT) <input type="text" size="8" name="_GMT"></strong>
<p>
Rome (GMT +1) <input type="text" size="8" name="rome"><br>
<p>
Hong Kong (GMT +8) <input type="text" size="8" name="ho"><br>
<p>
</form>
</center>

<p><center>
<font face="arial, helvetica" SIZE="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
</body>
</html>