public static String dayForWeek(String pTime) throws Throwable {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
c.setTime(format.parse(pTime));
int dayForWeek = 0;
String str="";
if(c.get(Calendar.DAY_OF_WEEK) == 1){
dayForWeek = 7;
}else{
dayForWeek = c.get(Calendar.DAY_OF_WEEK) - 1;
}
if(dayForWeek==1){
str="周一";
}else if(dayForWeek==2){
str="周二";
}
else if(dayForWeek==3){
str="周三";
}else if(dayForWeek==4){
str="周四";
}else if(dayForWeek==5){
str="周五";
}else if(dayForWeek==6){
str="周六";
}else if(dayForWeek==7){
str="周日";
}
return str;
}
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
c.setTime(format.parse(pTime));
int dayForWeek = 0;
String str="";
if(c.get(Calendar.DAY_OF_WEEK) == 1){
dayForWeek = 7;
}else{
dayForWeek = c.get(Calendar.DAY_OF_WEEK) - 1;
}
if(dayForWeek==1){
str="周一";
}else if(dayForWeek==2){
str="周二";
}
else if(dayForWeek==3){
str="周三";
}else if(dayForWeek==4){
str="周四";
}else if(dayForWeek==5){
str="周五";
}else if(dayForWeek==6){
str="周六";
}else if(dayForWeek==7){
str="周日";
}
return str;
}