Admins talk forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
FiB
New member
Posts : 17
Pts : 29
Reputation : 4
Join date : 2015-03-11
Full

Need clock testing please Empty Need clock testing please

Fri Jul 24, 2015 12:36 am
Can someone who is not in the uk try this clock and tell me if it works for them by giving them their local time.


Code:
<script type="text/javascript">
var tmonth=new Array("January","February","March","April","May","June","July","August","September","October","November","December");

function GetClock(){
var d=new Date();
var nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getYear();
if(nyear<1000) nyear+=1900;

var d=new Date();
var nhour=d.getHours(),nmin=d.getMinutes(),ap;
if(nhour==0){ap=" AM";nhour=12;}
else if(nhour<12){ap=" AM";}
else if(nhour==12){ap=" PM";}
else if(nhour>12){ap=" PM";nhour-=12;}

if(nmin<=9) nmin="0"+nmin;

document.getElementById('clockbox').innerHTML=""+tmonth[nmonth]+" "+ndate+", "+nyear+" "+nhour+":"+nmin+ap+"";
}

window.onload=function(){
GetClock();
setInterval(GetClock,1000);
}
</script>
<div id="clockbox">
  <div id="clockbox" style="font:14pt Arial; color:#F70D1A;">
  </div>
</div>
brandon_g
brandon_g
ATF Staff
ATF Staff
Posts : 621
Pts : 498
Reputation : 17
Join date : 2015-01-22
Location : USA
Full
http://broadcastingduo.forumotion.com

Need clock testing please Empty Re: Need clock testing please

Fri Jul 24, 2015 6:14 pm
Will the clock work in phpbb2 forums?
Back to top
Permissions in this forum:
You cannot reply to topics in this forum