Q: MediaStore - date modified don't work correctly I retrieve following values from the media store
MediaStore.Images.Media.DATE_TAKEN
MediaStore.Images.Media.DATE_MODIFIED

And read the dates from the result like following:
int dateTakenColumn = cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN);
int dateModifiedColumn = cursor.getColumnIndex(MediaStore.Images.Media.DATE_MODIFIED);
String dateToken  = cursor.getString(dateTakenColumn);
String dateModified = cursor.getString(dateModifiedColumn);
long lDateToken = dateToken != null ? Long.parseLong(dateToken) : 0;
long lDateModified = dateModified != null ? Long.parseLong(dateModified) : 0;

And can see following behaviour (example values):


*

*lDateToken looks like following:    1450696995000 <= CORRECT

*lDateModified looks like following: 1450696995    <= WRONG


It seems like the modification dates are all cut off. I checked the real files last modified date with a file explorer, and the values should be fine, but I always get such short numbers from my media files.
Any ideas on why this happens?
PS: checked this http://developer.android.com/reference/android/provider/MediaStore.Images.ImageColumns.html, but the modified field is not listed there...

A: DATE_TAKEN is in milliseconds since 1970. 
See the docs
DATE_MODIFIED is in seconds since 1970, so just multiply it by 1000 and it'll be fine.
See the docs

A: Just multiply it by 1000 to get correct date
fun convertLongToDate(time: Long): String =
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
            DateTimeFormatter.ofPattern("dd MMMM yyyy").format(
                    Instant.ofEpochMilli(time*1000)
                            .atZone(ZoneId.systemDefault())
                            .toLocalDate())
        } else {
            SimpleDateFormat("dd MMMM yyyy").format(
                    Date(time * 1000)
            )
        }

