标签: javascript date
我无法找出逻辑来检测它是否已超过某个小时......
var now = new Date(); if(now.getHours() <= 15 && now.getMinutes() < 1) console.log("It's before 3pm");
答案 0 :(得分:0)
唉,很傻。
var now = new Date(); if(now.getHours() >= 15) console.log('Past 3pm');