Post by SDT Papi on Feb 26, 2011 6:12:59 GMT -8
*** FINAL ***
I now, with the help of many, have 2 versions of the script, both with a minimize feature. Scripts are both listed below.
It has been asked of me why not show the diff between time zones, that is not the purpose of the clock, it does exactly as it was designed to do.
It shows the current time for the various time zones. That was its intent and that is the results. Nothing more Nothing less.
Code just updated
I was looking for a Time Zone Clock, but could not find what I was looking for. I found something along the lines of it but was very limited. I could not find the original code on the internet with any instructions.
I am not a coder, but I gave it a shot, I was 99.9% accurate on my code, I had one extra line of code that was not needed, a buddy took a look and suggested to remove it. So the end result is a working Time Zone Clock with all zones listed, here is the url to the page I run it on:
sdtm2010.proboards.com/index.cgi?board=scrimteam
I put the codes in the Header for the board I wanted them in, you could also put in your global or main, header or footer if you wish.
Here are the codes:
Version #1
Version #2
feed back would be nice as well as if its accepted or not.
I now, with the help of many, have 2 versions of the script, both with a minimize feature. Scripts are both listed below.
It has been asked of me why not show the diff between time zones, that is not the purpose of the clock, it does exactly as it was designed to do.
It shows the current time for the various time zones. That was its intent and that is the results. Nothing more Nothing less.
Code just updated
I was looking for a Time Zone Clock, but could not find what I was looking for. I found something along the lines of it but was very limited. I could not find the original code on the internet with any instructions.
I am not a coder, but I gave it a shot, I was 99.9% accurate on my code, I had one extra line of code that was not needed, a buddy took a look and suggested to remove it. So the end result is a working Time Zone Clock with all zones listed, here is the url to the page I run it on:
sdtm2010.proboards.com/index.cgi?board=scrimteam
I put the codes in the Header for the board I wanted them in, you could also put in your global or main, header or footer if you wish.
Here are the codes:
Version #1
<!-- **************************************** -->
<!-- Keep this Header intact out of courtesy -->
<!-- All Time Zones Clock Script #1 -->
<!-- Idea from other script, reworked for what I needed -->
<!-- Script reworked by Papi (Xfire=papi61) -->
<!-- Tweak by Topeka (xfire=topeka92) -->
<!-- Script reworked by a secrete person -->
<!-- Collapse/Expand added from script posted by Jordan on Proboards Support support.proboards.com/index.cgi?action=gotopost&board=coderequests&thread=110159&post=3533829 -->
<!-- Final rework (hopefully) by Papi (Xfire=papi61) -->
<!-- Keep this Header intact out of courtesy -->
<!-- **************************************** -->
<center>
<a href="Javascript:void(0);" onclick="toggle('form');">Clock Expand/Collapse</a>
</center>
<SCRIPT LANGUAGE="JavaScript">
<!-- 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 gmt012 =check24(((gmt - 12) > 24) ? ((gmt - 12) - 24) : (gmt - 12));
document.clock.gmt012.value = (IfZero(gmt012) + ending);
var gmt011 =check24(((gmt - 11) > 24) ? ((gmt - 11) - 24) : (gmt - 11));
document.clock.gmt011.value = (IfZero(gmt011) + ending);
var gmt010 =check24(((gmt - 10) > 24) ? ((gmt - 10) - 24) : (gmt - 10));
document.clock.gmt010.value = (IfZero(gmt010) + ending);
var gmt009 =check24(((gmt - 9) > 24) ? ((gmt - 9) - 24) : (gmt - 9));
document.clock.gmt009.value = (IfZero(gmt009) + ending);
var gmt008 =check24(((gmt - 8) > 24) ? ((gmt - 8) - 24) : (gmt - 8));
document.clock.gmt008.value = (IfZero(gmt008) + ending);
var gmt007 =check24(((gmt - 7) > 24) ? ((gmt - 7) - 24) : (gmt - 7));
document.clock.gmt007.value = (IfZero(gmt007) + ending);
var gmt006 =check24(((gmt - 6) > 24) ? ((gmt - 6) - 24) : (gmt - 6));
document.clock.gmt006.value = (IfZero(gmt006) + ending);
var gmt005 =check24(((gmt - 5) > 24) ? ((gmt - 5) - 24) : (gmt - 5));
document.clock.gmt005.value = (IfZero(gmt005) + ending);
var gmt004 =check24(((gmt - 4) > 24) ? ((gmt - 4) - 24) : (gmt - 4));
document.clock.gmt004.value = (IfZero(gmt004) + ending);
var gmt003 =check24(((gmt - 3) > 24) ? ((gmt - 3) - 24) : (gmt - 3));
document.clock.gmt003.value = (IfZero(gmt003) + ending);
var gmt002 =check24(((gmt - 2) > 24) ? ((gmt - 2) - 24) : (gmt - 2));
document.clock.gmt002.value = (IfZero(gmt002) + ending);
var gmt001 =check24(((gmt - 1) > 24) ? ((gmt - 1) - 24) : (gmt - 1));
document.clock.gmt001.value = (IfZero(gmt001) + ending);
var gmt000 =check24(((gmt - 1) > 24) ? ((gmt) - 24) : (gmt));
document.clock.gmt000.value = (IfZero(gmt000) + ending);
var gmt01 =check24(((gmt + 1) > 24) ? ((gmt + 1) - 24) : (gmt + 1));
document.clock.gmt01.value = (IfZero(gmt01) + ending);
var gmt02 =check24(((gmt + 2) > 24) ? ((gmt + 2) - 24) : (gmt + 2));
document.clock.gmt02.value = (IfZero(gmt02) + ending);
var gmt03 =check24(((gmt + 3) > 24) ? ((gmt + 3) - 24) : (gmt + 3));
document.clock.gmt03.value = (IfZero(gmt03) + ending);
var gmt04 =check24(((gmt + 4) > 24) ? ((gmt + 4) - 24) : (gmt + 4));
document.clock.gmt04.value = (IfZero(gmt04) + ending);
var gmt05 =check24(((gmt + 5) > 24) ? ((gmt + 5) - 24) : (gmt + 5));
document.clock.gmt05.value = (IfZero(gmt05) + ending);
var gmt06 =check24(((gmt + 6) > 24) ? ((gmt + 6) - 24) : (gmt + 6));
document.clock.gmt06.value = (IfZero(gmt06) + ending);
var gmt07 =check24(((gmt + 7) > 24) ? ((gmt + 7) - 24) : (gmt + 7));
document.clock.gmt07.value = (IfZero(gmt07) + ending);
var gmt08 =check24(((gmt + 8) > 24) ? ((gmt + 8) - 24) : (gmt + 8));
document.clock.gmt08.value = (IfZero(gmt08) + ending);
var gmt09 =check24(((gmt + 9) > 24) ? ((gmt + 9) - 24) : (gmt + 9));
document.clock.gmt09.value = (IfZero(gmt09) + ending);
var gmt10 =check24(((gmt + 10) > 24) ? ((gmt + 10) - 24) : (gmt + 10));
document.clock.gmt10.value = (IfZero(gmt10) + ending);
var gmt11 =check24(((gmt + 11) > 24) ? ((gmt + 11) - 24) : (gmt + 11));
document.clock.gmt11.value = (IfZero(gmt11) + ending);
var gmt12 =check24(((gmt + 12) > 24) ? ((gmt + 12) - 24) : (gmt + 12));
document.clock.gmt12.value = (IfZero(gmt12) + ending);
setTimeout("GetTime()", 1000);
}
function IfZero(num) {
return ((num <= 9) ? ("0" + num) : num);
}
function check24(hour) {
return (hour >= 24) ? hour - 24 : hour;
}
// End -->
</script>
<BODY onLoad="javascript:GetTime();">
<div id="form">
<center>
The Clock will be collapsed when you click on the link above.
</center>
<form name="clock">
<table class="titlebg" border="0" cellpadding="0" id="table1" width="360" align="center">
<tr>
<td colspan="4" class="catbg">
<center><a href="http://sdtm2010.proboards.com/index.cgi?board=scrimteam"><font color="FFCC00"> <font size="2">World Time Zones </font> </a></center>
</td>
</tr>
<tr>
<td width="160" align="center"><font color="FFCC00">GMT -12</font><br><input type="text" size="8" name="gmt012"></td>
<td width="160" align="center"><font color="FFCC00">GMT -11</font><br><input type="text" size="8" name="gmt011"></td>
<td width="160" align="center"><font color="FFCC00">GMT -10</font><br><input type="text" size="8" name="gmt010"></td>
<td width="160" align="center"><font color="FFCC00">GMT -9</font><br><input type="text" size="8" name="gmt009"></td>
</tr>
<tr>
<td width="160" align="center"><font color="FFCC00">GMT -8</font><br><input type="text" size="8" name="gmt008"></td>
<td width="160" align="center"><font color="FFCC00">GMT -7</font><br><input type="text" size="8" name="gmt007"></td>
<td width="160" align="center"><font color="FFCC00">GMT -6</font><br><input type="text" size="8" name="gmt006"></td>
<td width="160" align="center"><font color="FFCC00">GMT -5</font><br><input type="text" size="8" name="gmt005"></td>
</tr>
<tr>
<td width="160" align="center"><font color="FFCC00">GMT -4</font><br><input type="text" size="8" name="gmt004"></td>
<td width="160" align="center"><font color="FFCC00">GMT -3</font><br><input type="text" size="8" name="gmt003"></td>
<td width="160" align="center"><font color="FFCC00">GMT -2</font><br><input type="text" size="8" name="gmt002"></td>
<td width="160" align="center"><font color="FFCC00">GMT -1</font><br><input type="text" size="8" name="gmt001">
</td>
</tr>
<tr>
<td colspan="4" align="center">
<font color="FFCC00">GMT</font><br><input type="text" size="8" name="gmt000">
</td>
</tr>
<tr>
<td width="160" align="center"><font color="FFCC00">GMT +1</font><br><input type="text" size="8" name="gmt01"></td>
<td width="160" align="center"><font color="FFCC00">GMT +2</font><br><input type="text" size="8" name="gmt02"></td>
<td width="160" align="center"><font color="FFCC00">GMT +3</font><br><input type="text" size="8" name="gmt03"></td>
<td width="160" align="center"><font color="FFCC00">GMT +4</font><br><input type="text" size="8" name="gmt04"></td>
</tr>
<tr>
<td align="center"><font color="FFCC00">GMT +5</font><br><input type="text" size="8" name="gmt05"></td>
<td align="center"><font color="FFCC00">GMT +6</font><br><input type="text" size="8" name="gmt06"></td>
<td align="center"><font color="FFCC00">GMT +7</font><br><input type="text" size="8" name="gmt07"></td>
<td align="center"><font color="FFCC00">GMT +8</font><br><input type="text" size="8" name="gmt08"></td>
</tr>
<tr>
<td align="center"><font color="FFCC00">GMT +9</font><br><input type="text" size="8" name="gmt09"></td>
<td width="160" align="center"><font color="FFCC00">GMT +10</font><br><input type="text" size="8" name="gmt10"></td>
<td align="center"><font color="FFCC00">GMT +11</font><br><input type="text" size="8" name="gmt11"></td>
<td align="center"><font color="FFCC00">GMT +12</font><br><input type="text" size="8" name="gmt12"></td>
</tr>
<tr>
<td align="center" colspan="4"><font color="FFCC00">Your Local Time</font><br><input type="text" size="8" name="local"></td>
</font>
</tr>
</table>
</form>
</div>
</center>
<script type="text/javascript"><!--
var cookie_data = document.cookie.split(";");
for(a = 0; a < cookie_data.length; a++){
if(cookie_data[a].match(new RegExp("id:(.+?)=0($|;)","i"))){
if(document.getElementById(RegExp.$1))
document.getElementById(RegExp.$1).style.display = "none";
}
}
function toggle(_id){
var obj = document.getElementById(_id);
if(obj.style.display == ""){
obj.style.display = "none";
document.cookie = "id:" + _id + "=0;expires=Sat, 20 Jan 3000 12:12:12 UTC; path=/;";
} else {
obj.style.display = "";
document.cookie = "id:" + _id + "=0;expires=Sat, 20 Jan 2000 12:12:12 UTC; path=/;";
}
}
//-->
</script>
Version #2
<!-- **************************************** -->
<!-- Keep this Header intact out of courtesy -->
<!-- All Time Zones Clock Script #2 -->
<!-- Idea from other script, reworked for what I needed -->
<!-- Script reworked by Papi (Xfire=papi61) -->
<!-- Tweak by Topeka (xfire=topeka92) -->
<!-- Script reworked by a secrete person -->
<!-- Collapse/Expand added from script posted by Jordan on Proboards Support support.proboards.com/index.cgi?action=gotopost&board=coderequests&thread=110159&post=3533829 -->
<!-- Final rework (hopefully) by Papi (Xfire=papi61) -->
<!-- Keep this Header intact out of courtesy -->
<!-- **************************************** -->
<center>
<a href="Javascript:void(0);" onclick="toggle('form');">Clock Expand/Collapse</a>
</center>
<SCRIPT LANGUAGE="JavaScript">
<!-- 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 gmt012 =check24(((gmt - 12) > 24) ? ((gmt - 12) - 24) : (gmt - 12));
document.clock.gmt012.value = (IfZero(gmt012) + ending);
var gmt011 =check24(((gmt - 11) > 24) ? ((gmt - 11) - 24) : (gmt - 11));
document.clock.gmt011.value = (IfZero(gmt011) + ending);
var gmt010 =check24(((gmt - 10) > 24) ? ((gmt - 10) - 24) : (gmt - 10));
document.clock.gmt010.value = (IfZero(gmt010) + ending);
var gmt009 =check24(((gmt - 9) > 24) ? ((gmt - 9) - 24) : (gmt - 9));
document.clock.gmt009.value = (IfZero(gmt009) + ending);
var gmt008 =check24(((gmt - 8) > 24) ? ((gmt - 8) - 24) : (gmt - 8));
document.clock.gmt008.value = (IfZero(gmt008) + ending);
var gmt007 =check24(((gmt - 7) > 24) ? ((gmt - 7) - 24) : (gmt - 7));
document.clock.gmt007.value = (IfZero(gmt007) + ending);
var gmt006 =check24(((gmt - 6) > 24) ? ((gmt - 6) - 24) : (gmt - 6));
document.clock.gmt006.value = (IfZero(gmt006) + ending);
var gmt005 =check24(((gmt - 5) > 24) ? ((gmt - 5) - 24) : (gmt - 5));
document.clock.gmt005.value = (IfZero(gmt005) + ending);
var gmt004 =check24(((gmt - 4) > 24) ? ((gmt - 4) - 24) : (gmt - 4));
document.clock.gmt004.value = (IfZero(gmt004) + ending);
var gmt003 =check24(((gmt - 3) > 24) ? ((gmt - 3) - 24) : (gmt - 3));
document.clock.gmt003.value = (IfZero(gmt003) + ending);
var gmt002 =check24(((gmt - 2) > 24) ? ((gmt - 2) - 24) : (gmt - 2));
document.clock.gmt002.value = (IfZero(gmt002) + ending);
var gmt001 =check24(((gmt - 1) > 24) ? ((gmt - 1) - 24) : (gmt - 1));
document.clock.gmt001.value = (IfZero(gmt001) + ending);
var gmt000 =check24(((gmt - 1) > 24) ? ((gmt) - 24) : (gmt));
document.clock.gmt000.value = (IfZero(gmt000) + ending);
var gmt01 =check24(((gmt + 1) > 24) ? ((gmt + 1) - 24) : (gmt + 1));
document.clock.gmt01.value = (IfZero(gmt01) + ending);
var gmt02 =check24(((gmt + 2) > 24) ? ((gmt + 2) - 24) : (gmt + 2));
document.clock.gmt02.value = (IfZero(gmt02) + ending);
var gmt03 =check24(((gmt + 3) > 24) ? ((gmt + 3) - 24) : (gmt + 3));
document.clock.gmt03.value = (IfZero(gmt03) + ending);
var gmt04 =check24(((gmt + 4) > 24) ? ((gmt + 4) - 24) : (gmt + 4));
document.clock.gmt04.value = (IfZero(gmt04) + ending);
var gmt05 =check24(((gmt + 5) > 24) ? ((gmt + 5) - 24) : (gmt + 5));
document.clock.gmt05.value = (IfZero(gmt05) + ending);
var gmt06 =check24(((gmt + 6) > 24) ? ((gmt + 6) - 24) : (gmt + 6));
document.clock.gmt06.value = (IfZero(gmt06) + ending);
var gmt07 =check24(((gmt + 7) > 24) ? ((gmt + 7) - 24) : (gmt + 7));
document.clock.gmt07.value = (IfZero(gmt07) + ending);
var gmt08 =check24(((gmt + 8) > 24) ? ((gmt + 8) - 24) : (gmt + 8));
document.clock.gmt08.value = (IfZero(gmt08) + ending);
var gmt09 =check24(((gmt + 9) > 24) ? ((gmt + 9) - 24) : (gmt + 9));
document.clock.gmt09.value = (IfZero(gmt09) + ending);
var gmt10 =check24(((gmt + 10) > 24) ? ((gmt + 10) - 24) : (gmt + 10));
document.clock.gmt10.value = (IfZero(gmt10) + ending);
var gmt11 =check24(((gmt + 11) > 24) ? ((gmt + 11) - 24) : (gmt + 11));
document.clock.gmt11.value = (IfZero(gmt11) + ending);
var gmt12 =check24(((gmt + 12) > 24) ? ((gmt + 12) - 24) : (gmt + 12));
document.clock.gmt12.value = (IfZero(gmt12) + ending);
setTimeout("GetTime()", 1000);
}
function IfZero(num) {
return ((num <= 9) ? ("0" + num) : num);
}
function check24(hour) {
return (hour >= 24) ? hour - 24 : hour;
}
// End -->
</script>
<BODY onLoad="javascript:GetTime();">
<div id="form">
<center>
The Clock will be collapsed when you click on the link above.
</center>
<form name="clock">
<table class="windowbg" border="0" cellpadding="0" id="table1" width="380" align="center">
<tr>
<td colspan="4" class="titlebg" align="center">
<a href="http://sdtm2010.proboards.com/index.cgi?board=scrimteam"><font size="3">World Time Zones</font></a>
</td>
</tr><tr>
<td width="25%" align="center">GMT -12<br /><input type="text" size="8" name="gmt012"></td>
<td width="25%" align="center">GMT -11<br /><input type="text" size="8" name="gmt011"></td>
<td width="25%" align="center">GMT -10<br /><input type="text" size="8" name="gmt010"></td>
<td width="25%" align="center">GMT -9<br /><input type="text" size="8" name="gmt009"></td>
</tr><tr>
<td width="25%" align="center">GMT -8<br /><input type="text" size="8" name="gmt008"></td>
<td width="25%" align="center">GMT -7<br /><input type="text" size="8" name="gmt007"></td>
<td width="25%" align="center">GMT -6<br /><input type="text" size="8" name="gmt006"></td>
<td width="25%" align="center">GMT -5<br /><input type="text" size="8" name="gmt005"></td>
</tr><tr>
<td width="25%" align="center">GMT -4<br /><input type="text" size="8" name="gmt004"></td>
<td width="25%" align="center">GMT -3<br /><input type="text" size="8" name="gmt003"></td>
<td width="25%" align="center">GMT -2<br /><input type="text" size="8" name="gmt002"></td>
<td width="25%" align="center">GMT -1<br /><input type="text" size="8" name="gmt001"></td>
</tr><tr>
<td width="100%" colspan="4" align="center">GMT<br><input type="text" size="8" name="gmt000"></td>
</tr><tr>
<td width="25%" align="center">GMT +1<br /><input type="text" size="8" name="gmt01"></td>
<td width="25%" align="center">GMT +2<br /><input type="text" size="8" name="gmt02"></td>
<td width="25%" align="center">GMT +3<br /><input type="text" size="8" name="gmt03"></td>
<td width="25%" align="center">GMT +4<br /><input type="text" size="8" name="gmt04"></td>
</tr><tr>
<td width="25%" align="center">GMT +5<br /><input type="text" size="8" name="gmt05"></td>
<td width="25%" align="center">GMT +6<br /><input type="text" size="8" name="gmt06"></td>
<td width="25%" align="center">GMT +7<br /><input type="text" size="8" name="gmt07"></td>
<td width="25%" align="center">GMT +8<br /><input type="text" size="8" name="gmt08"></td>
</tr><tr>
<td width="25%" align="center">GMT +9<br /><input type="text" size="8" name="gmt09"></td>
<td width="25%" align="center">GMT +10<br /><input type="text" size="8" name="gmt10"></td>
<td width="25%" align="center">GMT +11<br /><input type="text" size="8" name="gmt11"></td>
<td width="25%" align="center">GMT +12<br /><input type="text" size="8" name="gmt12"></td>
</tr><tr>
<td width="100%" align="center" colspan="4" >Your Local Time<br><input type="text" size="8" name="local"></td>
</tr>
</table>
</form>
</div>
</center>
<script type="text/javascript"><!--
var cookie_data = document.cookie.split(";");
for(a = 0; a < cookie_data.length; a++){
if(cookie_data[a].match(new RegExp("id:(.+?)=0($|;)","i"))){
if(document.getElementById(RegExp.$1))
document.getElementById(RegExp.$1).style.display = "none";
}
}
function toggle(_id){
var obj = document.getElementById(_id);
if(obj.style.display == ""){
obj.style.display = "none";
document.cookie = "id:" + _id + "=0;expires=Sat, 20 Jan 3000 12:12:12 UTC; path=/;";
} else {
obj.style.display = "";
document.cookie = "id:" + _id + "=0;expires=Sat, 20 Jan 2000 12:12:12 UTC; path=/;";
}
}
//-->
</script>
feed back would be nice as well as if its accepted or not.