Android之把格林威治时间戳(10位数)转成年月日
作者:互联网
Android之把格林威治时间戳(10位数)转成年月日
源码
public static String formatData(String dataFormat, long timeStamp) {
if (timeStamp == 0) {
return "";
}
timeStamp = timeStamp * 1000;
String result = "";
SimpleDateFormat format = new SimpleDateFormat(dataFormat);
result = format.format(new Date(timeStamp));
return result;
}
使用
String factory_times = TimeUtils.formatData("yyyy年MM月dd日", Long.valueOf(carDetailData.getFactory_time()));
标签:10,String,格林威治,timeStamp,format,formatData,result,Android 来源: https://blog.csdn.net/qq_34316927/article/details/90901776