List of utility methods to do Calendar Second
boolean | after(final Calendar first, final Calendar second) after return !before(first, second);
|
void | clearCalendarSecondWithRear(Calendar cal) clear Calendar Second With Rear cal.set(Calendar.SECOND, cal.getActualMinimum(Calendar.SECOND)); clearCalendarMillisecond(cal); |
Boolean | dateEquals(Calendar calendarFirst, Calendar calendarSecond) date Equals if (calendarFirst.get(Calendar.YEAR) == calendarSecond.get(Calendar.YEAR)) if (calendarFirst.get(Calendar.MONTH) == calendarSecond.get(Calendar.MONTH)) if (calendarFirst.get(Calendar.DAY_OF_MONTH) == calendarSecond.get(Calendar.DAY_OF_MONTH)) return true; return false; |
int | getSecond(Calendar calendar) get Second return calendar.get(Calendar.SECOND);
|
int | getSecondsSinceMidnight(Calendar c) get Seconds Since Midnight return 3600 * c.get(Calendar.HOUR_OF_DAY) + 60 * c.get(Calendar.MINUTE) + c.get(Calendar.SECOND);
|
int | getSecondsSinceMidnight(final Calendar time) get Seconds Since Midnight return time.get(Calendar.SECOND) + (time.get(Calendar.MINUTE) * 60)
+ (time.get(Calendar.HOUR_OF_DAY) * 3600);
|
long | getTimeInSeconds(Calendar t) get Time In Seconds return t.getTimeInMillis() / 1000;
|
int | getTimeSeconds(Calendar cal) Wrapper for getTimeSeconds(int hour, int min). return getTimeSeconds(cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE));
|
int | getTimestampInDayFirstSecond(final Calendar calendar) get Timestamp In Day First Second Calendar other = (Calendar) calendar.clone();
other.set(Calendar.HOUR_OF_DAY, 0);
other.set(Calendar.MINUTE, 0);
other.set(Calendar.SECOND, 0);
other.set(Calendar.MILLISECOND, 0);
return getTimestamp(other.getTimeInMillis());
|
boolean | hasPassed10Second(Calendar time) has Passed Second Long currentTime = Calendar.getInstance().getTimeInMillis(); Long compareTime = time.getTimeInMillis(); if (currentTime - compareTime > 1000 * 10) { return true; } else { return false; |