Here you can find the source of getYesterdayBegin()
public static Date getYesterdayBegin()
//package com.java2s; import java.util.*; public class Main { public static Date getYesterdayBegin() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); calendar.add(Calendar.DATE, -1); return calendar.getTime(); }//from w ww. j av a 2 s . c o m }