JS 求解时间差
1 function UTCTimeDemo($str){ 2 var d, s = "当前 UTC 时间为: "; 3 var c = ":"; 4 d = new Date($str); 5 s = Date.parse(d); 6 return(s); 7 } 8 9 var t1 = UTCTimeDemo("2013-06-12"); 10 var t2 = UTCTimeDemo("2013-06-19"); 11 12 document.write((t2-t1)/1000/60/60/24); 13 14 =>7