Here you can find the source of beforeAMonth()
public static long beforeAMonth()
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static long beforeAMonth() { Calendar cal = Calendar.getInstance(); Date currentDate = new Date(); cal.setTime(currentDate);/* w w w. j a va2s. c o m*/ cal.add(Calendar.MONTH, -1); Date date = cal.getTime(); return date.getTime(); } }