Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int countDays(Date date1, Date date2) {
- Date startDate, endDate;
- int result;
- if (date1.before(date2))
- startDate = date1;
- else
- startDate = date2;
- if (date1.after(date2))
- endDate = date1;
- else
- endDate = date2;
- result = 1;
- while (startDate.before(endDate)) {
- startDate = startDate.nextDate();
- result++;
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement