Here you can find the source of getPreDay(Date date)
public static Date getPreDay(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date getPreDay(Date date) { Calendar c = Calendar.getInstance(); c.setTime(date);//from w w w .j a va2 s . com c.add(Calendar.DATE, -1); return c.getTime(); } }