Android Utililty Methods Today Get

List of utility methods to do Today Get

Description

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

Method

longgetToday()
get Today
Calendar cal = Calendar.getInstance();
String curDate = dateFormater2.get().format(cal.getTime());
curDate = curDate.replace("-", "");
return Long.parseLong(curDate);
StringgetLastyearToday(String str)
get Lastyear Today
String subYear = str.substring(0, 4);
String subMonth = str.substring(5, 7);
String subDay = str.substring(8, 10);
Long LongYear = new Long(subYear);
long longYear = LongYear.longValue();
longYear--;
lastYearToday = longYear + "-" + subMonth + "-" + subDay;
return lastYearToday;
...
StringgetTodayFull()
get Today Full
Calendar cal = Calendar.getInstance();
java.text.SimpleDateFormat sdf = new SimpleDateFormat(
        "yyyy-MM-dd 00:00:00");
String cdate = sdf.format(cal.getTime());
return cdate;
booleanisToday(Calendar today, Calendar date)
is Today
if (date == null) {
    return true;
Calendar otherday = getCalendar();
otherday.setTime(date.getTime());
return otherday.get(Calendar.YEAR) == today.get(Calendar.YEAR)
        && otherday.get(Calendar.MONTH) == today
                .get(Calendar.MONTH)
...
booleanisToday(Calendar date)
is Today
Calendar today = getCalendar();
return isToday(today, date);
intgetNbDaysToDate(Calendar from, int toYear, int toMonth, int toDay)
get Nb Days To Date
stripTime(from);
int todayJulianDay = getJulianDay(from);
Calendar eventCal = Calendar.getInstance();
eventCal.set(Calendar.YEAR, toYear);
eventCal.set(Calendar.MONTH, toMonth);
eventCal.set(Calendar.DAY_OF_MONTH, toDay);
stripTime(eventCal);
int eventJulianDay = getJulianDay(eventCal);
...
booleanisToday(long time)
is Today
GregorianCalendar calendar = (GregorianCalendar) Calendar
        .getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
int systemDay = calendar.get(Calendar.DAY_OF_MONTH);
int systemMonth = calendar.get(Calendar.MONTH);
int systemYear = calendar.get(Calendar.YEAR);
calendar.setTimeInMillis(time);
int day = calendar.get(Calendar.DAY_OF_MONTH);
...
Datetoday()
today
return Calendar.getInstance().getTime();
Stringtoday()
today
return getAsString(Calendar.getInstance());
booleanisToday(long lTime)
is Today
return isDateDayEqual(lTime, System.currentTimeMillis());