//String转化为Date类型,从而获取时间
//StringtimeStr = "2018-10-30"
public String getStringOfDateWeek(String timeStr){
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");//定义日期格式
Datedate = null;
try{
date = format.parse(timeStr);//将字符串转换为日期
}catch(ParseExceptione){
System.out.println("输入的日期格式不合理!");
}
SimpleDateFormat formatWeek = new SimpleDateFormat("EEEE");//星期几定义日期格式
String week=formatWeek.format(date);
return week;
}