public String parseDate(String thedate){
String strReturn = "";
SimpleDateFormat bartDateFormat = new SimpleDateFormat("yyyyMMdd");
String dateStringToParse = thedate;
try {
Date date = bartDateFormat.parse(dateStringToParse);
SimpleDateFormat bartDateFormat2 = new SimpleDateFormat("yyyy-MM-dd EEEE");
strReturn = bartDateFormat2.format(date);
}catch (Exception ex) {
ex.printStackTrace();
}
return strReturn;
}
public static void main(String[] args) {
Untitled1 test1 = new Untitled1();
System.out.println(test1.parseDate("20040702"));
}
转载于:https://www.cnblogs.com/lhxin/archive/2011/10/20/2218532.html