Here you can find the source of getAfterDays(String date, String pattern, int afterDays)
public static List<String> getAfterDays(String date, String pattern, int afterDays) throws Exception
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.List; public class Main { public static List<String> getAfterDays(String date, String pattern, int afterDays) throws Exception { List<String> list = new ArrayList<String>(); SimpleDateFormat sdf = new SimpleDateFormat(pattern); Date getDate = sdf.parse(date); GregorianCalendar gc = new GregorianCalendar(); gc.setTime(getDate);/*from www . java 2 s . co m*/ for (int i = 0; i < afterDays; i++) { gc.add(Calendar.DATE, 1); getDate = gc.getTime(); list.add(sdf.format(getDate)); } return list; } }