Hi all,
I am designing 5 digital clocks with different timing of course through the below action script, and it is working great except Sydney and Tokyo, the problem is that it does not switch from PM to AM…it is only PM, below is the code of Sydney clock, and as for Tokyo I add +10.
Can you guys know what is wrong here ?
P.S : I place for New York : -3 for Cairo : +3 for London :+2, so do u think the reason for this issue of sydney and tokyo that the hour add is two digit ( above 10 )???
thanks in advance.
time=new Date(); // time object
var seconds = time.getUTCSeconds()
var minutes = time.getUTCMinutes()
var hours = time.getUTCHours()
[B][COLOR=”Red”]hours = hours +11;
if (hours<12) {
ampm = “AM”;
}
else{
ampm = “PM”;
}
while(hours >12){
hours = hours – 12;
}
if(hours<10)
{
hours = “0” + hours;
}
if(minutes<10)
{
minutes = “0” + minutes;
}
if(seconds<10)
{
seconds = “0” + seconds;
}
clock_txt.text = hours + “:” + minutes + “:” + seconds +” “+ ampm;