Android Utililty Methods Yesterday Get

List of utility methods to do Yesterday Get

Description

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

Method

StringgetYestoday(String sourceDate, String format)
get Yestoday
return getFormatDateAdd(getDateFromString(sourceDate, format), -1,
        format);
StringgetYestoday(String sourceDate, String format)
get Yestoday
return getFormatDateAdd(getDateFromString(sourceDate, format), -1,
        format);
StringgetFormatYestoday(String format)
get Format Yestoday
return getFormatCurrentAdd(-1, format);
booleanisYesterday(long date)
Checks if the given date is yesterday.
final Calendar currentDate = Calendar.getInstance();
currentDate.setTimeInMillis(date);
final Calendar yesterdayDate = Calendar.getInstance();
yesterdayDate.add(Calendar.DATE, -1);
return yesterdayDate.get(Calendar.YEAR) == currentDate
        .get(Calendar.YEAR)
        && yesterdayDate.get(Calendar.DAY_OF_YEAR) == currentDate
                .get(Calendar.DAY_OF_YEAR);
...
StringgetYesterdayFormattedTime()
get Yesterday Formatted Time
Calendar calendar = getCurrentCalendar();
calendar.add(Calendar.HOUR_OF_DAY, -9);
calendar.add(Calendar.DAY_OF_MONTH, -1);
SimpleDateFormat format = new SimpleDateFormat(
        "yyyy-MM-dd'T'HH:mm:ssz");
String result = format.format(calendar.getTime());
String standardName = "";
if (result.contains("JST")) {
...
DategetYesterday()
get Yesterday
Date today = getToday();
Date yesterday = new Date(today.getYear(), today.getMonth(),
        today.getDate() - 1); 
return yesterday;