Here you can find the source of monthAdd(final String strDate, final int month)
public static String monthAdd(final String strDate, final int month)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String monthAdd(final String strDate, final int month) { final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date;// w ww. j a v a2 s . c om try { date = simpleDateFormat.parse(strDate); final Calendar calender = Calendar.getInstance(); calender.setTime(date); calender.add(Calendar.MONTH, month); return simpleDateFormat.format(calender.getTime()); } catch (final ParseException e) { e.printStackTrace(); } return null; } }