[removed] IF time >= 9:30 then

前端 未结 8 2105
一整个雨季
一整个雨季 2020-12-30 11:25

I\'m trying to write a statement that says \"if time is this and less than that then\". I can use get hours and get min. However, I\'m having problems combining a time suc

8条回答
  •  感动是毒
    2020-12-30 11:54

      var now = new Date();
      var closeTime = new Date();
      closeTime.setHours(9); closeTime.setMinutes(30);
      console.log(now, closeTime, now.getTime() >= closeTime.getTime());
    

    close time is based on today, then we just change the hours and minutes to 9:30.

提交回复
热议问题