Commit c104c824614e135f282db8a937b3ff55e8dd9794
1 parent
8525f98807
Exists in
master
and in
1 other branch
月龄计算
Showing 1 changed file with 3 additions and 3 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
c104c82
... | ... | @@ -478,7 +478,7 @@ |
478 | 478 | |
479 | 479 | result = c2.get(Calendar.MONDAY) - c1.get(Calendar.MONTH); |
480 | 480 | |
481 | - return result == 0 ? 1 : Math.abs(result)-1; | |
481 | + return result == 0 ? 1 : Math.abs(result); | |
482 | 482 | |
483 | 483 | } |
484 | 484 | |
... | ... | @@ -593,8 +593,8 @@ |
593 | 593 | System.out.println(new DateTime().minusDays(77));*/ |
594 | 594 | // System.out.println(getDaySeconds()); |
595 | 595 | |
596 | -// String s = getBabyMonthAge(parseYMD("2016-05-16"), new Date()); | |
597 | -// System.out.println(s); | |
596 | + String s = getBabyMonthAge(parseYMD("2016-08-01"), new Date()); | |
597 | + System.out.println(s); | |
598 | 598 | // SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd "); |
599 | 599 | // System.out.println(getBabyAgeMonth(parseYMD("2016-05-23"), new Date())); |
600 | 600 | // System.out.println(DateUtil.getyyyy_MM_dd_hms(DateUtil.addDay(new Date(),-108))); |