Check if two times overlap

前端 未结 5 915
生来不讨喜
生来不讨喜 2020-12-09 13:12

I want to see if a time I read from a db overlaps with a time provided by a user.

My database looks like this:

--------------------------------------         


        
5条回答
  •  星月不相逢
    2020-12-09 13:59

    In case when $to is always later than $from we can use this more shorter solutions

    $another_meeting = !($from > $to_compare || $from_compare > $to);
    

提交回复
热议问题