java时间判断

DateTime now = DateUtil.date();
//开始时间
String start = DateUtil.today() + " " + systemConstants.attendanceStartTime;
//结束时间
String end = DateUtil.today() + " " + systemConstants.attendanceEndTime;
DateTime attendanceStart = DateUtil.parse(start);
DateTime attendanceEnd = DateUtil.parse(end);
if (now.isBefore(attendanceStart)) {
return "没有到上班考勤开始时间";
} else if (now.isAfter(attendanceEnd)) {
return "超过了上班考勤结束时间";

posted @ 2023-04-19 11:20  不想挨捶的牛  阅读(42)  评论(0编辑  收藏  举报