Android Utililty Methods Hour Get

List of utility methods to do Hour Get

Description

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

Method

intgetHour()
get Hour
return Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
booleanbetweenHours(int tuntil_h, int tfrom_h, int tuntil_m, int tfrom_m, int c_hour, int c_min)
Check if current time is between given hours
if (tuntil_h < tfrom_h) {
    if (c_hour <= tuntil_h)
        c_hour += 24;
    tuntil_h += 24;
int ctime = c_hour * 60 + c_min;
int u_time = tuntil_h * 60 + tuntil_m;
int f_time = tfrom_h * 60 + tfrom_m;
...
booleanisBeforeHourTime(String compactTime, int hour)
is Before Hour Time
Log.d(TAG, "compateTime: " + compactTime);
if (compactTime.trim().length() < 14) {
    return true;
String beforeTime = addHourTime(hour);
Log.d(TAG, "beforeTime: " + beforeTime);
if (compactTime.compareTo(beforeTime) < 0) {
    return true;
...