<<< GregorianCalendar to Date | Index | The DateFormat class >>> |
Code that calculates the number of days between two dates
Date startDate = gregStartDate.getTime(); Date endDate = gregEndDate.getTime(); long startDateMS = startDate.getTime(); long endDateMS = endDate.getTime(); long elapsedMS = endDateMS – startDateMS; long elapsedDays = elapsedMS / (24 * 60 * 60 * 1000);
<<< GregorianCalendar to Date | Index | The DateFormat class >>> |