Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to calculate date and time in call logs
    primarykey
    data
    text
    <p>Does anyone know how to display the call log details for individual calls? When I go into my call history, the only times shown are "1 hour ago, 3 hours ago, yesterday, 2 days ago" etc. Is there any way to view the actual time and date for a call? Also, I noticed that when looking at this information for a text message, the "sent" time is inaccurate. Someone can text me at 12:51 AM and the phone will show, "sent at 6:31 PM, received at 12:51 AM". Does anyone know how to fix this?</p> <pre><code>Cursor callLogCursor = getContentResolver().query( android.provider.CallLog.Calls.CONTENT_URI, null, null, null, android.provider.CallLog.Calls.DEFAULT_SORT_ORDER); if (callLogCursor != null) { while (callLogCursor.moveToNext()) { String name = callLogCursor.getString(callLogCursor .getColumnIndex(CallLog.Calls.CACHED_NAME)); String number = callLogCursor.getString(callLogCursor .getColumnIndex(CallLog.Calls.NUMBER)); long dateTimeMillis = callLogCursor.getLong(callLogCursor .getColumnIndex(CallLog.Calls.DATE)); String duration = callLogCursor.getString(callLogCursor .getColumnIndex(CallLog.Calls.DURATION)); int callType = callLogCursor.getInt(callLogCursor .getColumnIndex(CallLog.Calls.TYPE)); Date date = new Date(dateTimeMillis); String dateString = new SimpleDateFormat("yyyy-MM-dd HH:mm") .format(date); if (name == null) name = "Unknown"; int type = 0; switch (callType) { case CallLog.Calls.OUTGOING_TYPE: type = R.drawable.out; break; case CallLog.Calls.INCOMING_TYPE: type = R.drawable.in; break; case CallLog.Calls.MISSED_TYPE: type = R.drawable.miss; break; } Thanks for your help! </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload