Here you can find the source of getDayByOfSomeMonth(String curday, int month)
public static String getDayByOfSomeMonth(String curday, int month) throws ParseException
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String getDayByOfSomeMonth(String curday, int month) throws ParseException { SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); Date mydate = formatter.parse(curday); Calendar calendar = Calendar.getInstance(); calendar.setTime(mydate);//from ww w. j av a2s .c om calendar.add(Calendar.MONTH, month); return formatter.format(calendar.getTime()); } }