JS date对象的减法处理
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
d.sky
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