Here you can find the source of afterNDaysDate(String theDate, int nDayNum, String format)
public static String afterNDaysDate(String theDate, int nDayNum, String format) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { public static String afterNDaysDate(String theDate, int nDayNum, String format) throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat(format); Date dd1 = sdf.parse(theDate); Calendar cal = Calendar.getInstance(); cal.setTime(dd1);/*from ww w . j a va2 s .co m*/ cal.add(Calendar.DAY_OF_YEAR, nDayNum); sdf.setTimeZone(TimeZone.getDefault()); return (sdf.format(cal.getTime())); } }