<!-- clock hack-->
<div id="clock">Loading...</div>
<script type="text/javascript">
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var day=d.getDay();
var date=d.getDate();
var month=d.getMonth();
var year=d.getFullYear();
var days=new Array("Sun","Mon","Tue","Wed","Thurs","Fri","Sat");
var months=new Array("1","2","3","4","5","6","7","8","9","10","11","12");
var am_pm;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h>12) {h-=12;am_pm = "pm"}
else {am_pm="am"}
if (h<10) {h="0" + h}
document.getElementById("clock").innerHTML=months[month] + "-" + date + "-" + year + " [" + days[day] + "] [" + h + ":" + m + ":" + s + "] " + am_pm;
setTimeout("refrClock()",1000);
}
refrClock();
</script>
<!-- / clock hack -->
<!-- clock hack-->
<div id="clock">Loading...</div>
<script type="text/javascript">
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var day=d.getDay();
var date=d.getDate();
var month=d.getMonth();
var year=d.getFullYear();
var days=new Array("Sunday","Monday","Tuesday","Wednesday","Thu rsday","Friday","Saturday");
var months=new Array("January","February","March","April","May"," June","July","August","Septemb er","October","November","December");
var AM_PM;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h>12) {h-=12;AM_PM = "PM"}
else {AM_PM="AM"}
if (h<10) {h="0" + h}
document.getElementById("clock").innerHTML=days[day] + " " + months[month] + " " + date + "," + " " + year + " " + h + ":" + m + ":" + s + " " + AM_PM;
setTimeout("refrClock()",1000);
}
refrClock();
</script>
<!-- / clock hack -->
For those asking, "Why?", I think it would come in handy if someone is burdened with running Windows and IE when the IE window is maximized and system tray clock can't be seen. No need to make the bar visible just to see the time if it's already in the forum. Plus, if you're looking at the calendar, maybe you need a reminder of the date and time.
<!-- clock hack-->
<div id="clock">Loading...</div>
<script type="text/javascript">
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var day=d.getDay();
var date=d.getDate();
var month=d.getMonth();
var year=d.getFullYear(); var days=new Array("Domingo","Lunes","Martes","Miercoles","Juev es","Viernes","Sabado");
var months=new Array("Ene","Feb","Mar","Abr","May","Jun","Jul","A go","Sep","Oct","Nov","Dic");
var am_pm;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h>12) {h-=12;am_pm = "pm"}
else {am_pm="am"}
if (h<10) {h="0" + h}
document.getElementById("clock").innerHTML=days[day] + " " + date + "/" + months[month] + "/" + year + " " + h + ":" + m + ":" + s + " " + am_pm;
setTimeout("refrClock()",1000);
}
refrClock();
</script>
<!-- / clock hack -->
Is there any way to make this come from the server time? We run auctions on our site and it would be nice if everyone was looking at the same time for auction end. Thanks!
and, if you would like to change the color of your font's to stand out more then the other color's in your welcome box, use this code and just change the #0000FF to what ever color you would like.
Quote:
<!-- clock hack -->
<font color="#0000FF">
<div id="clock">Loading...</div>
<script type="text/javascript">
function refrClock()
{
var d=new Date();
var s=d.getSeconds();
var m=d.getMinutes();
var h=d.getHours();
var day=d.getDay();
var date=d.getDate();
var month=d.getMonth();
var year=d.getFullYear();
var days=new Array("Sun","Mon","Tue","Wed","Thurs","Fri","Sat") ;
var months=new Array("1","2","3","4","5","6","7","8","9","10","11 ","12");
var am_pm;
if (s<10) {s="0" + s}
if (m<10) {m="0" + m}
if (h>12) {h-=12;am_pm = "pm"}
else {am_pm="am"}
if (h<10) {h="0" + h}
document.getElementById("clock").innerHTML=months[month] + "-" + date + "-" + year + " " + days[day] + " " + h + ":" + m + ":" + s + " " + am_pm;
setTimeout("refrClock()",1000);
}
refrClock();
</script></font>
<!-- / clock hack -->