var curTime = new Date();
//2把字符串格式转换为日期类
var startTime = new Date(Date.parse("2018-3-28 16:44"));
var endTime = new Date(Date.parse("2018-3-28 16:45"));
console.log(startTime)
console.log(endTime )
//3进行比较
console.log(curTime >= startTime && curTime <= endTime);