Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
var thetime = '2018-04-17 19:09:00';
var d=new Date(Date.parse(thetime .replace(/-/g,"/")));
var curDate=new Date();
if(d <=curDate){
alert("小于当前时间");
}else{
alert("大于当前时间");
}