标签:mat long form except auto format generate string led
public static String getDays(Object date){
if(null!=date){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date SD=null;
try {
SD = sdf.parse(date.toString());
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//获取天数
long days = (SD.getTime())/(24*60*60*1000);
return days+"";
}else{
return "";
}
}
标签:mat long form except auto format generate string led
原文地址:http://www.cnblogs.com/mjbenkyo/p/7268538.html