[B]Dear all
following code snippet is about the digital clock where i am passing the server time in variable “time_string” , now i want to make this work , This time will be fetched everytime same so how can i assign this time to new Date(); so everytime it will update it …
[code]
var time_str = document.clock_form.time_str.value ; //Sat, 05 Jun 2010 16:48:00 +0530
function dotime(){
theTime=setTimeout(‘dotime();’,1000);
d= new Date(Date.parse(time_str));
var hr= d.getHours()+100;
var mn= d.getMinutes()+100;
var se= d.getSeconds()+100;
if(hr==100){
hr=112;am_pm=’am’;
}
else if(hr<112){
am_pm=’am’;
}
else if(hr==112){
am_pm=’pm’;
}
else if(hr>112){
am_pm=’pm’;hr=(hr-12);
}
tot=”+hr+mn+se;
document.hr1.src = ‘/flash_files/digits/dg’+tot.substring(1,2)+’.gif’;
document.hr2.src = ‘/flash_files/digits/dg’+tot.substring(2,3)+’.gif’;
document.mn1.src = ‘/flash_files/digits/dg’+tot.substring(4,5)+’.gif’;
document.mn2.src = ‘/flash_files/digits/dg’+tot.substring(5,6)+’.gif’;
document.se1.src = ‘/flash_files/digits/dg’+tot.substring(7,8)+’.gif’;
document.se2.src = ‘/flash_files/digits/dg’+tot.substring(8,9)+’.gif’;
document.ampm.src= ‘/flash_files/digits/dg’+am_pm+’.gif’;
}
dotime();
Only once it work and give error , Plz help me out
Thanks in advance