var str = '2019-9-20';
str = str.replace(/-/g,"/");
var date = new Date(str );
var now = new Date();
if(date < now) {
document.write("过期");
} else {
var time = date - now;
document.write("没过期");
// alert((time/1000/60/60/24)+'Day');
}
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询