diff --git a/scheduler/src/main/java/com/zfoo/scheduler/util/TimeUtils.java b/scheduler/src/main/java/com/zfoo/scheduler/util/TimeUtils.java index 03254f21..76ca47b4 100644 --- a/scheduler/src/main/java/com/zfoo/scheduler/util/TimeUtils.java +++ b/scheduler/src/main/java/com/zfoo/scheduler/util/TimeUtils.java @@ -357,6 +357,12 @@ public abstract class TimeUtils { return LocalDateTime.ofInstant(instant, zone); } + // --------------------------------------时间大小判断-------------------------------------- + public static boolean timeBetween(long time, long from, long end) { + return from <= time && time <= end; + } + + // --------------------------------------cron表达式-------------------------------------- public static long nextTimestampByCronExpression(CronExpression expression, long currentTimestamp) { var zonedDateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(currentTimestamp), DEFAULT_ZONE_ID);