Here you can find the source of afterNDay(int n)
public static String afterNDay(int n)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String afterNDay(int n) { Calendar c = Calendar.getInstance(); DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); c.setTime(new Date()); c.add(Calendar.DATE, n);/*from ww w . java2 s. c o m*/ Date d2 = c.getTime(); String s = df.format(d2); return s; } }