String[] timePhase = reservationRuleInDTO.getTimePhase().split(",");
List<ReservationTimeRule> reservationTimeRuleList = new ArrayList<>();
for(int i =0;i<timePhase.length;i++){
reservationTimeRule = new ReservationTimeRule();
if(timePhase[i]!=null){
Date d = format.parse(timePhase[i]);
Time time = new Time(d.getTime());
reservationTimeRule.setStartTime(time);
}

时间的大小的比较
SimpleDateFormat  ymdFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat hmsFormat = new SimpleDateFormat("HH:mm:ss");
// DateFormat d3 = DateFormat.getTimeInstance();
// 当前时段+间隔时间(之后再说)
String nowTimes = hmsFormat.format(new Date());
if(reservationRule != null && reservationRule.getStatus()==1){
// 给前端返回时段列表(获取当期时间判断所能预约的时段)
List<ReservationTimeRule> reservationTimeRules = timeRuleMapper.selectTimeByReservationId(reservationRule.getId());
List<ReservationTimeRule> reservationTimeRuleList= new ArrayList<>();
for (ReservationTimeRule reservationTimeRule :reservationTimeRules) {
String sdTimes = reservationTimeRule.getStartTime().toString();
if (hmsFormat.parse(sdTimes).getTime() > hmsFormat.parse(nowTimes).getTime()){
reservationTimeRuleList.add(reservationTimeRule);
}
}