user785975
user785975

Reputation: 169

How to convert a date from android provider date call logs?

i would like to convert a date from android provider call log. The actual date is 1341238489840.

int _DATE =  calls.getColumnIndex(android.provider.CallLog.Calls.DATE);
String date = calls.getString(_DATE);

Upvotes: 0

Views: 448

Answers (2)

Shabbir Panjesha
Shabbir Panjesha

Reputation: 1939

You can you this code i have tested it

public class CDate {
        public static void main(String[] args) {
            Date date = new Date(1341238489840L);
            System.out.println(new SimpleDateFormat("dd:MM:yyyy", Locale.ENGLISH)
                    .format(date));
        }
    }

Upvotes: 0

KV Prajapati
KV Prajapati

Reputation: 94645

Use SimpleDateFormat to format the date.

  Date dt=new Date(1341238489840L);

Upvotes: 1

Related Questions