How to get StartTime and EndTime from an event from android calendar? I am using this code for get all the data of the event but it gives me StartDate and EndDate but i need Date + Time of both Start and End. here’s the code
CalNames[i] = "Event" + cursor_event.getInt(0) + ": \nTitle: "
+ cursor_event.getString(1) + "\nDescription: "
+ cursor_event.getString(2) + "\nStart Date: "
+ new Date(cursor_event.getLong(3)) + "\nEnd Date : "
+ new Date(cursor_event.getLong(4)) + "\nLocation : "
+ cursor_event.getString(5);
Use
cursor_event.getLong(cursor_event.getColumnIndex("dtstart"))to get time the event starts in UTC millis since epoch.To get event end time use
cursor_event.getLong(cursor_event.getColumnIndex("dtend"))All event columns you can find here http://developer.android.com/reference/android/provider/CalendarContract.EventsColumns.html#DTEND