Compare string date to current long time
<p>A search API is returning date in <code>String</code> format,I want to compare that date with current date and do something. I created a date object and parsed it but still getting error when I do the compare. </p>

<pre><code>Calendar currentDate = Calendar.getInstance();
long dateNow = currentDate.getTimeInMillis();

String eventDate = meta.getString("startDate"); //This is the string API returns

SimpleDateFormat formatter  = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss.SSS");
Date date = formatter.parse(eventDate);
long modifiedDate= date.getTime();

if (dateNow.compareTo(modifiedDate)&gt;0) {
    //Do Something
}                            
</code></pre>

<p><strong>Error I get is :</strong> </p>

<pre><code>Cannot invoke compareTo(long) on the primitive type long
</code></pre>

<p>Thanks. </p>
