title: Android difference between two dates in seconds
body: <p>I've tried different methods around the web but couldn't make it work. </p>
  
  <pre><code>Cursor cursor = sqlite.myDataBase.rawQuery("SELECT StartDate, EndDate FROM Tracks Where Id="+'"'+trackId+'"',null);
  
  SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  Date startDate = outputFormat.parse(cursor.getString(cursor.getColumnIndex("StartDate")));
  Date endDate = outputFormat.parse(cursor.getString(cursor.getColumnIndex("EndDate")));
  </code></pre>
  
  <p>In this way I get both dates in good format. Now I want to find the difference between <code>EndDate</code> and <code>Startdate</code> in seconds.</p>
  
  <p>Any advice? Thank you.</p>