List of utility methods to do Hour
boolean | isHour(int hour) is Hour return getHourOfDay() == hour;
|
Date | nextHour(Date date) next Hour long now = date.getTime(); int min = Integer.valueOf(minuteFormat.format(date)); int sec = Integer.valueOf(secondFormat.format(date)); long begin = now - min * 60 * 1000 - sec * 1000; long end = begin + 60 * 60 * 1000; return new Date(end); |
Date | nextHour(int hour) next Hour Calendar now = now();
now.set(Calendar.HOUR_OF_DAY, now.get(Calendar.HOUR_OF_DAY) + hour);
return now.getTime();
|
long | resetHourMillisToZero(long millis) reset Hour Millis To Zero Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(millis);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTimeInMillis();
|
Date | tomrrow(int hour, int minute, int second) tomrrow return nextDay(1, hour, minute, second);
|