/** * 判断当前日期是否在[startDate, endDate]区间 * * @param startDate 开始日期 * @param endDate 结束日期 * @author jqlin * @return */ public static boolean isEffectiveDate(Date startDate, Date endDate){ if(startDate == null || endDate == null){ return false; } long currentTime = new Date().getTime(); if(currentTime >= startDate.getTime() && currentTime <= endDate.getTime()){ return true; } return false; }
判断当前日期是否在[startDate, endDate]区间
日期有效性检查
最新推荐文章于 2024-01-09 11:33:45 发布
本文介绍了一个实用的方法来判断当前日期是否位于指定的起始日期和结束日期之间。此方法通过比较当前时间戳与给定的时间范围来进行验证。

1079

被折叠的 条评论
为什么被折叠?



