java中double类型1.0E7进行数字换算

转:http://www.lianhekj.com/question/262394221.html

String strTime ="";
Double object = 1.0E7;
if(object!=null){
strTime = new DecimalFormat("#").format(object);
}
Long updateDate=0L;
try {
updateDate = Long.valueOf(strTime);
}catch (NumberFormatException e){
updateDate=System.currentTimeMillis()/1000;
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date date = new Date(updateDate*1000);
String upTime = simpleDateFormat.format(date);

猜你喜欢

转载自blog.csdn.net/majunzhu/article/details/86665257