Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String getFormatDate(int step) { Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, step); SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); String str = sf.format(cal.getTime()); return str; } }