/** * Returns true if both date are in the same year, month and day of month, hour, minute and second, false otherwise. * @param actual the actual date. expected not be null * @param other the other date. expected not be null * @return true if both date are in the same year, month and day of month, hour, minute and second, false otherwise. */ private static boolean areInSameSecondWindow(Date actual, Date other) { return timeDifference(actual, other) < TimeUnit.SECONDS.toMillis(1); }
/** * Returns true if both date are in the same year, month and day of month, hour, minute and second, false otherwise. * @param actual the actual date. expected not be null * @param other the other date. expected not be null * @return true if both date are in the same year, month and day of month, hour, minute and second, false otherwise. */ private static boolean areInSameHourWindow(Date actual, Date other) { return timeDifference(actual, other) < TimeUnit.HOURS.toMillis(1); }
private static boolean areInSameMinuteWindow(Date actual, Date other) { return timeDifference(actual, other) < TimeUnit.MINUTES.toMillis(1); }
/** * Returns true if both date are in the same year, month and day of month, hour, minute and second, false otherwise. * @param actual the actual date. expected not be null * @param other the other date. expected not be null * @return true if both date are in the same year, month and day of month, hour, minute and second, false otherwise. */ private static boolean areInSameHourWindow(Date actual, Date other) { return timeDifference(actual, other) < TimeUnit.HOURS.toMillis(1); }
/** * Returns true if both date are in the same year, month and day of month, hour, minute and second, false otherwise. * @param actual the actual date. expected not be null * @param other the other date. expected not be null * @return true if both date are in the same year, month and day of month, hour, minute and second, false otherwise. */ private static boolean areInSameSecondWindow(Date actual, Date other) { return timeDifference(actual, other) < TimeUnit.SECONDS.toMillis(1); }
private static boolean areInSameMinuteWindow(Date actual, Date other) { return timeDifference(actual, other) < TimeUnit.MINUTES.toMillis(1); }
final long millisecondsDiff = timeDifference(date1, date2); final long secondsDiff = millisecondsDiff / SECONDS.toMillis(1); final long minutesDiff = millisecondsDiff / MINUTES.toMillis(1);
final long millisecondsDiff = timeDifference(date1, date2); final long secondsDiff = millisecondsDiff / SECONDS.toMillis(1); final long minutesDiff = millisecondsDiff / MINUTES.toMillis(1);