public boolean inTimeRange(String startTime,String endTime,String targetTime,String format){
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
Calendar calendar = Calendar.getInstance();
calendar.setTime(simpleDateFormat.parse(startTime));
Date start = calendar.getTime();
calendar.setTime(simpleDateFormat.parse(endTime));
Date end = calendar.getTime();
calendar.setTime(simpleDateFormat.parse(targetTime));
Date target = calendar.getTime();
if (target.before(end)&&target.after(start)){
return true;
}
} catch (ParseException e) {
return false;
}
return false;
}