Here you can find the source of getPrevDay(Date date)
public static Date getPrevDay(Date date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Date getPrevDay(Date date) { if (date == null) { throw new NullPointerException(); }/* w w w .ja va 2 s . c o m*/ Calendar calendar = new GregorianCalendar(); calendar.setTime(date); calendar.add(Calendar.DAY_OF_YEAR, -1); return calendar.getTime(); } }