java8 LocalDate 日期比较大小
生活随笔
收集整理的这篇文章主要介绍了
java8 LocalDate 日期比较大小
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
java8 LocalDate 日期比较大小
/*** 比较第一个日期是否大于第二个日期* @param firstDate 第一个日期* @param secondDate 第二个日期* @return true-大于;false-不大于*/ public boolean localDateIsBefore(LocalDate firstDate, LocalDate secondDate) {return firstDate.isBefore(secondDate); }/*** 比较第一个日期是否小于第二个日期* @param firstDate 第一个日期* @param secondDate 第二个日期* @return true-小于;false-大于*/ public boolean localDateIsAfter(LocalDate firstDate, LocalDate secondDate) {return firstDate.isAfter(secondDate); }/*** 比较两个日期是否相等* @param firstDate 第一个日期* @param secondDate 第二个日期* @return true-相等;false-不相等*/ public boolean localDateIsEqual(LocalDate firstDate, LocalDate secondDate) {return firstDate.isEqual(secondDate); }总结
以上是生活随笔为你收集整理的java8 LocalDate 日期比较大小的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: Java实现List中某个对象属性中的字
- 下一篇: js base_64 解密