我想用 Jquery 检查当前时间是否在上午 10.30 到上午 11.30 之间。我将如何以正确的方式做到这一点?
我尝试了以下方式,但它没有按我的预期工作
function compareTime(){
var d = new Date(), // current time
hours = d.getHours(),// current hour
mins = d.getMinutes(); // current minute
var sTime = "10.30";
var eTime = "11.30";
var cTime = hours+'.'+mins;
if(sTime < cTime < eTime){
// here i want to do something if the current time is in between ...
}else{
}
}