function compareDate(dateTime1,dateTime2) { var formatDate1 = new Date(dateTime1); var formatDate2 = new Date(dateTime2); if(formatDate1 > formatDate2) { return true; }else{ return false; } } console.info("1234".contains(1)) var aaa = compareDate("2019-05-01 12:02:00","2019-05-01 12:00:00")//须将日期转换成 console.info(aaa) console.info("1111")