title: How to compare time ranges?
body: <p>Hi i am trying to compare time ranges,My requirement is when i select time from time-picker dialog it should be under given time ranges for this i wrote below code this is working when i not select 12 or 00 from time picker dialog </p>
  
  <p><strong>start time:06:00</strong>
  <strong>end time:23:00</strong>
  <strong>selected time from time picker dialog:12:23</strong></p>
  
  <p>above timing not suitable for below code can some one help me please</p>
  
  <pre><code>     String pattern = "hh:mm";                                            
       SimpleDateFormat sdf = new SimpleDateFormat(pattern);
       Date date1 = sdf.parse(startTime);
       Date date2 = sdf.parse(endTime);
       Date date3 = sdf.parse(selectedTime);
       if (((date3.after(date1) || date3.equals(date1)) &amp;&amp; (date3.before(date2) || date3.equals(date2)))) {         
  
  
       }
       else {
             Toast.makeText(context, "Pickup time should be open and close timings", Toast.LENGTH_SHORT).show();                                         
        }
  </code></pre>