Studyon Minte9.com
Java SE




Diff




package testexample; import java.util.Calendar; public class Test { public static void main(String[] args) { Calendar day = Calendar.getInstance(); day.set(2014, 0, 15); // 0 for January Calendar today = Calendar.getInstance(); // 2013-01-17 long diff = (today.getTimeInMillis() - day.getTimeInMillis()) / (1000 * 60 * 60 * 24); System.out.println(diff); // Outpu: 43 days (between 15.01.2014 and 27.02.2014) } }
 


http://stackoverflow.com/questions/3838527/android-java-date-difference-in-days