@Test public void testGetDayDifferenceOfReadableInts() { checkDayDifference(20110101, 20110101, 0); checkDayDifference(20110101, 20110102, 1); checkDayDifference(20110101, 20110103, 2); checkDayDifference(20110101, 20110201, 31); checkDayDifference(20110101, 20110301, 59); checkDayDifference(20110102, 20110101, -1); checkDayDifference(20110103, 20110101, -2); checkDayDifference(20110201, 20110101, -31); checkDayDifference(20110301, 20110101, -59); checkDayDifference(20111231, 20120101, 1); }
public static int getDayDifferenceOfReadableInts(int dayOfBroadcast1, int dayOfBroadcast2) { long time1 = getTimeFromDayReadableInt(dayOfBroadcast1); long time2 = getTimeFromDayReadableInt(dayOfBroadcast2); float daysFloat = (time2 - time1) / 1000 / 60 / 60 / 24f; return Math.round(daysFloat); }
DateUtils { public static int getDayDifferenceOfReadableInts(int dayOfBroadcast1, int dayOfBroadcast2) { long time1 = getTimeFromDayReadableInt(dayOfBroadcast1); long time2 = getTimeFromDayReadableInt(dayOfBroadcast2); float daysFloat = (time2 - time1) / 1000 / 60 / 60 / 24f; return Math.round(daysFloat); } }
DateUtils { public static int getDayDifferenceOfReadableInts(int dayOfBroadcast1, int dayOfBroadcast2) { long time1 = getTimeFromDayReadableInt(dayOfBroadcast1); long time2 = getTimeFromDayReadableInt(dayOfBroadcast2); float daysFloat = (time2 - time1) / 1000 / 60 / 60 / 24f; return Math.round(daysFloat); }  }
DateUtils { public static int getDayDifferenceOfReadableInts(int dayOfBroadcast1, int dayOfBroadcast2) { long time1 = getTimeFromDayReadableInt(dayOfBroadcast1); long time2 = getTimeFromDayReadableInt(dayOfBroadcast2); float daysFloat = (time2 - time1) / 1000 / 60 / 60 / 24f; return Math.round(daysFloat); }  static long getTimeForDay(int year, int month, int day); static long getTimeForDay(Calendar calendar, int year, int month, int day); static void setTime(Calendar calendar, int hourOfDay, int minute, int second, int millisecond); static int getDayAsReadableInt(long time); static int getDayAsReadableInt(Calendar calendar); static long getTimeFromDayReadableInt(int day); static long getTimeFromDayReadableInt(Calendar calendar, int readableDay, int hour); static int getDayDifferenceOfReadableInts(int dayOfBroadcast1, int dayOfBroadcast2); static int getDayDifference(long time1, long time2); static long addDays(long time, int days); static void addDays(Calendar calendar, int days); }
DateUtils { public static int getDayDifferenceOfReadableInts(int dayOfBroadcast1, int dayOfBroadcast2) { long time1 = getTimeFromDayReadableInt(dayOfBroadcast1); long time2 = getTimeFromDayReadableInt(dayOfBroadcast2); float daysFloat = (time2 - time1) / 1000 / 60 / 60 / 24f; return Math.round(daysFloat); }  static long getTimeForDay(int year, int month, int day); static long getTimeForDay(Calendar calendar, int year, int month, int day); static void setTime(Calendar calendar, int hourOfDay, int minute, int second, int millisecond); static int getDayAsReadableInt(long time); static int getDayAsReadableInt(Calendar calendar); static long getTimeFromDayReadableInt(int day); static long getTimeFromDayReadableInt(Calendar calendar, int readableDay, int hour); static int getDayDifferenceOfReadableInts(int dayOfBroadcast1, int dayOfBroadcast2); static int getDayDifference(long time1, long time2); static long addDays(long time, int days); static void addDays(Calendar calendar, int days);  }