|
|
@ -580,6 +580,29 @@ public class DateUtils { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 判断是否等于当前日期 |
|
|
|
* |
|
|
|
* @param nowTime 传入需要判断的日期 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public static boolean isEffectiveDate(Date nowTime) { |
|
|
|
|
|
|
|
// 格式转换
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
String nowDateTime = simpleDateFormat.format(nowTime); |
|
|
|
String newDateTime = simpleDateFormat.format(new Date()); |
|
|
|
|
|
|
|
// 判断传入日期(nowDateTime)是否等于当前日期(newDateTime)
|
|
|
|
if (nowDateTime.equals(newDateTime)) { |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public static final String parseDateToStr(final String format, final Date date) { |
|
|
|
return new SimpleDateFormat(format).format(date); |
|
|
|
} |
|
|
|