See if the current time falls within a specific range of time in the current day in Java

前端 未结 6 884
天命终不由人
天命终不由人 2020-12-10 13:52

I am sure this was done 1000 times in 1000 different places. The question is I want to know if there is a better/standard/faster way to check if current \"time\" is between

6条回答
  •  遥遥无期
    2020-12-10 14:58

    The dateFromHourMinSec method is flawed as written. It won't allow any hours where the seconde digit is greater than 3, e.g. 18:00:00. If you change it to allow [0-2][0-9] it will allow times such as 29:00:00. Have a fix for that?

提交回复
热议问题