更改android的媒体DATE_TAKEN格式(change android's media DATE_TAKEN format)
我正在获取使用的日期图像
int columnIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN);
String dateAdded = cursor.getString(columnIndex);
我得到的结果是dateFormat = 1430334035295
如何将dateAdded转换为正确的MM-dd-yyyy hh:mm:ss格式?
I am obtaining the date image was captured using
int columnIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN);
String dateAdded = cursor.getString(columnIndex);
The result i get is dateFormat = 1430334035295
How do I convert dateAdded into a proper MM-dd-yyyy hh:mm:ss format??
原文:https://stackoverflow.com/questions/30106784
更新时间:2020-02-26 19:35
最满意答案
String format = "MM-dd-yyyy HH:mm:ss";
SimpleDateFormat formatter = new SimpleDateFormat(format, Loc