SimpleDateFormat df = new SimpleDateFormat("yyyy-mm-dd hh:MM:ss");
String START_TIME = df.format(sysUser.getStartTime());
String END_TIME = df.format(sysUser.getEndTime());
String current_time = df.format(new Date());
try {
Date startTime= df.parse(START_TIME);
Date endTime= df.parse(END_TIME);
Date currenttime = df.parse(current_time);
if (currenttime.getTime() > startTime.getTime() && currenttime.getTime() < endTime.getTime()) {
return error("");
}
}catch (Exception e){
return error(e.getMessage());
}