In Java Micro Edition you do not have GregorianCalendar, so you need to use:
Date startDate, endDate;
...
int days = (int) ((endDate.getTime() - startDate.getTime())
/ (1000 * 60 * 60 * 24));
Where is the getTime () Date method returns the number of milliseconds since January 1, 1970, 00:00:00 GMT
source
share