title: time compare showing wrong result using PHP
body: <p>I have following mysql table</p>
  
  <pre><code>id      shopid      date            starttime       end_time
  1       1           2019-08-08      09:10           10:12
  2       1           2019-08-08      14:10           15:15
  </code></pre>
  
  <p>i want to compare with my dynamic "start_time" and "end_time",but my current result is wrong
  i want if user send "start" and "end" time which not between database saved time , then record should insert
  otherwise showing "time exist" message,I Tried with following code</p>
  
  <pre><code>foreach($rows as $rw)
  {
      date_default_timezone_set('UTC');
      echo "req time is".$_POST['start_time'];
      $your_date = date("m-d-Y", strtotime($add_data['service_date']));
      $req_stime = strtotime( $your_date." ".$_POST['start_time']);
      $req_etime = strtotime( $your_date." ".$_POST['end_time']);
      $bookedstime = strtotime( $rw['services_dates']." ".$rw['start_time']);
      $bookedetime = strtotime( $rw['services_dates']." ".$rw['end_time']);
  
      if(($req_stime&gt;=$bookedstime || $req_stime&lt;=$bookedetime) || ($req_etime&gt;=$bookedstime &amp;&amp; $req_etime&lt;=$bookedetime))
      {
          echo "exist";
      }
      else
      {
          //insert query
      }
  }
  </code></pre>