//1获取当前时间 var curTime = new Date(); //2把字符串格式转换为日期类 var startTime = new Date(Date.parse(kc.begintime)); var endTime = new Date(Date.parse(kc.endtime)); //3进行比较 return (curTime>=startTime && curTime<=endTime);
时间: 2024-10-12 04:41:57
//1获取当前时间 var curTime = new Date(); //2把字符串格式转换为日期类 var startTime = new Date(Date.parse(kc.begintime)); var endTime = new Date(Date.parse(kc.endtime)); //3进行比较 return (curTime>=startTime && curTime<=endTime);