Here you can find the source of getPreviousMonth(Date time)
public static Date getPreviousMonth(Date time)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getPreviousMonth(Date time) { Calendar calendar = Calendar.getInstance(); if (null != time) { calendar.setTimeInMillis(time.getTime()); }//from ww w . j av a 2 s. c o m calendar.add(Calendar.MONTH, -1); return new Date(calendar.getTimeInMillis()); } }