Android Utililty Methods Calendar Get

List of utility methods to do Calendar Get

Description

The list of methods to do Calendar Get are organized into topic(s).

Method

StringgetGuessedDateString()
get Guessed Date String
return getYear()
        + "-"
        + (getMonth() + 1)
        + "-"
        + (getDate() + getDateOffset() + (needsMidnightCountdown() ? 1
                : 0));
intgetHour(Calendar c)
get Hour
if (c != null) {
    return c.get(Calendar.HOUR);
} else {
    return Calendar.getInstance().get(Calendar.HOUR);
TimestampgetLastOfWeek(Calendar cal, int week)
get Last Of Week
if (cal == null) {
    cal = Calendar.getInstance();
cal.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.MINUTE, 59);
cal.set(Calendar.SECOND, 59);
cal.set(Calendar.MILLISECOND, 999);
...
longgetMaxTimeMillisToday()
get Max Time Millis Today
return getMaxTimeMillisToday(Calendar.getInstance());
longgetMaxTimeMillisToday(final Calendar calendar)
get Max Time Millis Today
Calendar endTotalCalendar = calendar;
if (endTotalCalendar == null) {
    endTotalCalendar = Calendar.getInstance();
endTotalCalendar.set(Calendar.HOUR_OF_DAY, 23);
endTotalCalendar.set(Calendar.MINUTE, 59);
endTotalCalendar.set(Calendar.SECOND, 59);
return endTotalCalendar.getTimeInMillis();
...
longgetMinTimeMillisToday()
get Min Time Millis Today
return getMinTimeMillisToday(Calendar.getInstance());
longgetMinTimeMillisToday(final Calendar calendar)
get Min Time Millis Today
Calendar startTotalCalendar = calendar;
if (startTotalCalendar == null) {
    startTotalCalendar = Calendar.getInstance();
startTotalCalendar.set(Calendar.HOUR_OF_DAY, 0);
startTotalCalendar.set(Calendar.MINUTE, 0);
startTotalCalendar.set(Calendar.SECOND, 0);
return startTotalCalendar.getTimeInMillis();
...
longgetMinTimeMillisWeek()
get Min Time Millis Week
final Calendar startTotalCalendar = GregorianCalendar.getInstance();
startTotalCalendar.set(Calendar.DAY_OF_WEEK,
        startTotalCalendar.getFirstDayOfWeek());
startTotalCalendar.set(Calendar.HOUR_OF_DAY, 0);
startTotalCalendar.set(Calendar.MINUTE, 0);
startTotalCalendar.set(Calendar.SECOND, 0);
return startTotalCalendar.getTimeInMillis();
intgetMinute()
get Minute
return cal().get(Calendar.MINUTE);
intgetMinute(Calendar c)
get Minute
if (c != null) {
    return c.get(Calendar.MINUTE);
} else {
    return Calendar.getInstance().get(Calendar.MINUTE);