js time with the current time

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.
This link: https://blog.csdn.net/qq_25889465/article/details/100566931
 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("大于当前时间");
        }

 

Guess you like

Origin blog.csdn.net/qq_25889465/article/details/100566931