public static boolean isWeekend(String date) throws ParseException{
DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");
Date bdate = format1.parse(date);
Calendar cal = Calendar.getInstance();
cal.setTime(bdate);
if(cal.get(Calendar.DAY_OF_WEEK)==Calendar.SATURDAY||cal.get(Calendar.DAY_OF_WEEK)==Calendar.SUNDAY){
return true;
}
else return false;
}
判断一个日期是否是周六、周日
猜你喜欢
转载自blog.csdn.net/gaofenglxx/article/details/60140083
今日推荐
周排行