Here you can find the source of getYesterday(Date date)
public static Date getYesterday(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date getYesterday(Date date) { Calendar c = Calendar.getInstance(); c.setTime(date);/*from www .j av a 2s . c o m*/ int day = c.get(Calendar.DATE); c.set(Calendar.DATE, day - 1); return c.getTime(); } public static int get(Date date, int field) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar.get(field); } }