title: Get Nearest time Android
body: <p>I have One value of date time like "30-01-2014 22:50".</p>
  
  <p>I have database of Date with same format but in datatype is String.</p>
  
  <p>Now I want nearest time from database of given date-time "30-01-2014 22:50".</p>
  
  <p>Example :</p>
  
  <p>Value I have :<code>"30-01-2014 22:50"</code></p>
  
  <p>Database :</p>
  
  <pre><code>"30-01-2014 02:20"
  "30-01-2014 05:30" 
  "30-01-2014 22:55"
  "30-01-2014 10:50"
  "30-01-2014 22:54"`
  </code></pre>
  
  <p>So the output should be.</p>
  
  <p><code>"30-01-2014 22:54"</code></p>
  
  <p>How can I achieve this?</p>
  
  <p><code>date1.after(date2)  and date1.before(date3)</code></p>
  
  <p>Is there any kind of function for time?</p>
  
  <p>Thanks</p>