my code is like this
int dateColumn = c.getColumnIndex(android.provider.CallLog.Calls.DATE);
long callDate = c.getInt(dateColumn);
SimpleDateFormat datePattern = new SimpleDateFormat ("dd-MM-yyyy:h:m:s:a");
datePattern.setTimeZone(TimeZone.getTimeZone("GMT"));
String date_str = datePattern.format(new Date(callDate));
serializer.text(date_str);
Log.v("",""+date_str);
it gives output as:23-08-1969:4:34:05:PM
instead of correct date it gives me long age date .
how to get the correct date can any body tell me….
String date_str = datePattern.format(new Date(callDate));
serializer.text(date_str);
Log.v(“”,””+date_str);
I strongly suspect the problem is here:
Given that you want a
longvalue, I’d expect this to be: