/**
* 校验传入的星期日期是否是今天
* @param dayOfWeek
* @return
*/
public static Boolean checkEqualDayOfWeek(String dayOfWeek){
String[] weekDays = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
try {
//如果是北京时间时区设置GMT+8
TimeZone.setDefault(TimeZone.getTimeZone("Europe/Amsterdam"));
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("Europe/Amsterdam"));
String weekDay = weekDays[calendar.get(Calendar.DAY_OF_WEEK) - 1];
log.info("------今天是:{}--------",weekDay);
if(weekDay.equals(dayOfWeek)){
return true;
}
}catch (Exception e){
log.error("------校验传入的星期日期是否是今天异常:{}--------",e);
}
return false;
}