Here you can find the source of getNextMonthPreviousDay(Date date, int month_num)
public static Date getNextMonthPreviousDay(Date date, int month_num)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date getNextMonthPreviousDay(Date date, int month_num) { Calendar c = Calendar.getInstance(); c.setTime(date);//from w w w .j av a 2s . c o m c.add(Calendar.MONTH, month_num); //set next month c.add(Calendar.DAY_OF_MONTH, -1); return c.getTime(); } }