- FiBNew member
- Posts : 17
Pts : 29
Reputation : 4
Join date : 2015-03-11
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>
Permissions in this forum:
You cannot reply to topics in this forum
|
|