private String getDate(File file)
{
String pattern="";
Calendar now=Calendar.getInstance();
Date fileDate=new Date(file.lastModified());
if(fileDate.before(now.getTime()))
pattern="MM/dd/yyyy hh:mm a";
else
pattern="EEEE hh:mm a";
SimpleDateFormat formatter=new SimpleDateFormat(pattern);
return formatter.format(fileDate);
}
{
String pattern="";
Calendar now=Calendar.getInstance();
Date fileDate=new Date(file.lastModified());
if(fileDate.before(now.getTime()))
pattern="MM/dd/yyyy hh:mm a";
else
pattern="EEEE hh:mm a";
SimpleDateFormat formatter=new SimpleDateFormat(pattern);
return formatter.format(fileDate);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货