Android Calendar Add yesterday(Calendar c)

Here you can find the source of yesterday(Calendar c)

Description

yesterday

Declaration

public static Calendar yesterday(Calendar c) 

Method Source Code

//package com.java2s;

import java.util.Calendar;

public class Main {
    public static Calendar yesterday(Calendar c) {
        long offset = 1 * 24 * 60 * 60 * 1000;
        Calendar calendar = null;
        if (c != null) {
            calendar = c;/*from www.  ja v a 2 s  . c  om*/
        } else {
            calendar = Calendar.getInstance();
        }

        calendar.setTimeInMillis(calendar.getTimeInMillis() - offset);
        return calendar;
    }
}

Related

  1. getDateAdd(Date date, int amount)
  2. getDateByAddFltHour(float flt)
  3. getDateByAddHour(String datetime, int minute)
  4. getFormatCurrentAdd(int amount, String format)
  5. tomorrow(Calendar c)
  6. addToCurrent(int type, int i)
  7. rollGetDate(Calendar calendar, int days)