代码如下
var a = '2016-01-01 12:12:12';
var b = '2016-01-01 12:12:13';
var al = new Date(a).getTime();
var bl = new Date(b).getTime();
if(al > bl) {
// do something
}
代码如下
var a = '2016-01-01 12:12:12';
var b = '2016-01-01 12:12:13';
var al = new Date(a).getTime();
var bl = new Date(b).getTime();
if(al > bl) {
// do something
}
转载于:https://www.cnblogs.com/martinl/p/7833804.html