复制代码 代码如下:
var time1="2010-11-01 10:12:12";
var time2="2010-11-01 11:12:12";
var t1=new Date(time1.replace(/-/g, '/'));
var t2=new Date(time2.replace(/-/g, '/'));
alert((t2-t1).toString()=="3600000"?"yes":"no");
时间: 2024-09-20 07:27:18
复制代码 代码如下:
var time1="2010-11-01 10:12:12";
var time2="2010-11-01 11:12:12";
var t1=new Date(time1.replace(/-/g, '/'));
var t2=new Date(time2.replace(/-/g, '/'));
alert((t2-t1).toString()=="3600000"?"yes":"no");