Is there a way to post Time Zone Clocks in SharePoint? My company has offices located around the world and we would like to have a table or banner that displays time zones for like Eastern, Central, Mountain, Pacific, Japan, Korea, Guam, and Diego Garcia, that uses your computer's system clock as its time source. What would be the script for something like that?
Stump the Panel » Site Managers and Site Collection Managers
Time Zone Clocks
(9 posts)-
Posted 4 days ago #
-
I came across this and thought you might fidn it useful.
http://8002.freesharepoint2007.com/default.aspxTherese
Posted 4 days ago # -
It is pretty neat, but we can't advertise on our website. I just need a simple table with maybe the location, time and date.
Posted 3 days ago # -
Can't remember where we got the code, but I did the same thing for my company:
Plunk this in a Content Editor Web Part. Adjust timezones as needed and fancy up the table formatting if you like
<script type="text/javascript"> <!-- function getObj(name) { if (document.getElementById) return document.getElementById(name); else if (document.all) return document.all[name]; else if (document.layers) return document.layers[name]; return false; } // function to calculate local time // in a different city // given the city's UTC offset var timer_id = 0; function updateTimer(timer_id, city, offset) { var obj = null; if ( !(obj = getObj("timer_" + timer_id)) ) return; obj.innerHTML = cityTime(city, offset); setTimeout("updateTimer(" + timer_id + ", '"+city+"', '"+offset+"')", 1000); } function cityTime(city, offset) { // avoid errors in offset values offset = parseInt(offset); // create Date object for current location d = new Date(); // convert to msec // add local time zone offset // get UTC time in msec utc = d.getTime() + (d.getTimezoneOffset() * 60000); // create new Date object for different city // using supplied offset nd = new Date(utc + (3600000*offset)); // Get simple time in hours, minutes, and AM/PM var hours = nd.getHours() % 12 + 1; var minutes = nd.getMinutes(); var seconds = nd.getSeconds(); var am_pm = (nd.getHours() >= 11) ? "PM" : "AM" ; // return time as a string if (minutes < 10) { return "" + hours + ":" + "0" + minutes + " " + am_pm + ""; } else { return "" + hours + ":" + minutes + am_pm + ""; } // return "The local time in " + city + " is " + nd.toLocaleString(); // Old return statement } function calcTime(city, offset) { timer_id++; setTimeout("updateTimer(" + timer_id + ", '"+city+"', '"+offset+"')", 1000); return "<span id=\"timer_"+timer_id+"\">" + cityTime(city,offset) + "</span>"; } //--> </script> <table border="0" cellspacing="0" cellpadding="1"> <tr> <td>Atlantic</td> <td><script type="text/javascript">document.write(calcTime('ADT', '-4'));</script></td> </tr> <tr> <td>Eastern</td> <td><script type="text/javascript">document.write(calcTime('ADT', '-5'));</script></td> </tr> <tr> <td>Central</td> <td><script type="text/javascript">document.write(calcTime('ADT', '-6'));</script></td> </tr> <tr> <td>Mountain</td> <td><script type="text/javascript">document.write(calcTime('ADT', '-7'));</script></td> </tr> <tr> <td>Pacific</td> <td><script type="text/javascript">document.write(calcTime('ADT', '-8'));</script></td> </tr> </table>
.
.
.
Update:I believe the code is from this site:
http://articles.techrepublic.com.com/5100-10878_11-6016329.htmland modified with help from this forum thread:
http://www.gimptalk.com/forum/javascript-time-zone-help--t4988s200.htmlPosted 3 days ago # -
A variation on the table (instead of stacked):
<TABLE cellSpacing=3 cellPadding=2 border=0>
<TBODY>
<TR>
<TD>Atlantic</TD>
<TD>
<SCRIPT type=text/javascript>document.write(calcTime('ADT', '-4'));</SCRIPT>
</TD>
<TD>Mountain</TD>
<TD>
<SCRIPT type=text/javascript>document.write(calcTime('ADT', '-7'));</SCRIPT>
</TD></TR><TR>
<TD>Eastern</TD>
<TD>
<SCRIPT type=text/javascript>document.write(calcTime('ADT', '-5'));</SCRIPT>
</TD>
<TD>Pacific</TD>
<TD>
<SCRIPT type=text/javascript>document.write(calcTime('ADT', '-8'));</SCRIPT>
</TD></TR><TR>
<TD>Central</TD>
<TD colspan="3">
<SCRIPT type=text/javascript>document.write(calcTime('ADT', '-6'));</SCRIPT>
</TD></TR>
</TBODY></TABLE>
Posted 3 days ago # -
have you looked at the Bamboo World Clock And Weather Web Part?
Posted 2 days ago # -
Here's another vote for the Bamboo World Clock and Weather web part. We found it to be easy to install, easy to configure and nice-looking. And, it's free. Worth checking out, anyway. It probably keeps track of who is/is not in daylight-savings time better than the JavaScript, too.
Posted 2 days ago # -
The Bamboo World Clock and Weather web part is probably GREAT -- and better than the above. I'd LOVE to use it!!
BUT it does require you to "install" it onto the server. If you do not have server access, then you cannot use it.
What I like about the above is as a Site Owner -- I can add it or not. What I appreciate about the EndUserSharePoint.Com site and this forum is that it provides ways for all of us to improve out sites.
Posted 2 days ago # -
Thank you all for the information. I went to the Bamboo World Clock and Weather website (http://store.bamboosolutions.com/pc-55-1-world-clock-and-weather-web-part.aspx), but notice most of the clocks advertised this site. Is that the case when you install this application?
Posted 1 day ago #
Reply
You must log in to post.