Here you can find the source of getInsertDayDate(int days)
public static String getInsertDayDate(int days)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String getInsertDayDate(int days) { Calendar day = Calendar.getInstance(); day.add(Calendar.DATE, -days); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); return simpleDateFormat.format(day.getTime()); }/*w w w. ja v a2 s . c om*/ public static String format(String pattern, Date date) { SimpleDateFormat f = new SimpleDateFormat(pattern); return f.format(date); } }