//获取当前时间
var currentTime = new Date();

//自定义时间
var customTime="2019-03-01 00:00:00";  
customTime= customTime.replace("-","/");//替换字符,变成标准格式  
customTime= new Date(Date.parse(customTime));

if(currentTime < customTime){
    alert("当前时间小于自定义时间");
}


var oDate1 = new Date('2019-03-01');
var oDate2 = new Date('2019-03-01');
if(oDate1 > oDate2){
        console.log('第一个大');
} else {
        console.log('第二个大');
}

 

相关文章:

  • 2022-12-23
  • 2021-11-21
  • 2022-02-12
  • 2021-11-16
  • 2021-08-20
猜你喜欢
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
相关资源
相似解决方案