@Test public void getDifferenceInSecondsTest() { Calendar oldCalendar = Calendar.getInstance(); oldCalendar.set(2015, Calendar.JANUARY, 1, 1, 1, 1); Calendar newCalendar = Calendar.getInstance(); newCalendar.set(2015, Calendar.JANUARY, 1, 1, 1, 11); assertEquals(10, TimeUtils.getDifferenceInSeconds(oldCalendar, newCalendar)); }
public static long getDifferenceInSeconds(Calendar calendarStart, Calendar calendarEnd) { return (calendarEnd.getTimeInMillis() - calendarStart.getTimeInMillis())/1000; }
TimeUtils { public static long getDifferenceInSeconds(Calendar calendarStart, Calendar calendarEnd) { return (calendarEnd.getTimeInMillis() - calendarStart.getTimeInMillis())/1000; } }
TimeUtils { public static long getDifferenceInSeconds(Calendar calendarStart, Calendar calendarEnd) { return (calendarEnd.getTimeInMillis() - calendarStart.getTimeInMillis())/1000; } private  TimeUtils(); }
TimeUtils { public static long getDifferenceInSeconds(Calendar calendarStart, Calendar calendarEnd) { return (calendarEnd.getTimeInMillis() - calendarStart.getTimeInMillis())/1000; } private  TimeUtils(); static long getDifferenceInSeconds(Calendar calendarStart, Calendar calendarEnd); }
TimeUtils { public static long getDifferenceInSeconds(Calendar calendarStart, Calendar calendarEnd) { return (calendarEnd.getTimeInMillis() - calendarStart.getTimeInMillis())/1000; } private  TimeUtils(); static long getDifferenceInSeconds(Calendar calendarStart, Calendar calendarEnd);  }