0
我在mysql中有两个实体,分别是opening_hours和closing_hours。我把它们存储为一个时间例如:在jQuery中比较时间
opening_hours : 08:00:00
closing_hours : 17:30:00
我想比较那些与当前时间。
我正在使用moment.js获取当前时间。
current_time = moment().format('HH:mm:ss');
它现在返回18:13:42。
我想写;如果当前时间大于opening_hours且小于closing_hours,则做某事。
有没有办法没有拆分?
你应该删除'mysql'标签,因为这个问题不是MySQL相关的 – Gab
@Gab肯定...... – Nevermore
为什么你需要momentJs呢? JavaScript日期是数字,所以只需将它们相互减去,看看你是否得到一个正数。 – krillgar