KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've tried different methods around the web but couldn't make it work. 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"))); In this way I get both dates in good format. Now I want to find the difference between EndDate and Startdate in seconds. Any advice? Thank you.
Tags (comma-separated)
Save Edits
Cancel