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