[removed] IF time >= 9:30 then

前端 未结 8 2104
一整个雨季
一整个雨季 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:58

    Try this:

    var now = new Date(); 
    var hour = now.getHours(); 
    var mintues = now.getMinutes();
    
    if(
            (hour*60 + mintues) > 570 && 
            hour <= 11
        )
    {
        document.write(now); 
    }
    

提交回复
热议问题