Android time format compare
<p>How do I compare a string time like "18:45" with the current system time?
I am using: </p>

<pre><code>SimpleDateFormat sdf = new SimpleDateFormat("HH:mm",Locale.US);
String time2 = "18:45";
long dtMili = System.currentTimeMillis();
Date date1 = new Date(dtMili); //current system time
Date date2 = sdf.parse(time2);
if (date2.after(date1)) {
    //bingo!
}
</code></pre>

<p>Debugging values--I found <code>date1</code> as current system datetime and <code>date2</code> as <code>"January 1970 - 18:45"</code></p>

<p>I need to compare only times, the date must be same.</p>
