1 var time1 = " 2010-11-01 10:12:12 " ; 2 var time2 = " 2010-11-01 11:12:12 " ; 3 4 var t1 = new Date(time1.replace( / - / g, ' / ' )); 5 var t2 = new Date(time2.replace( / - / g, ' / ' )); 6 7 alert((t2 - t1).toString() == " 3600000 " ? " yes " : " no " ); 8