Here you can find the source of getDaysLater(int day)
public static String getDaysLater(int day)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String getDaysLater(int day) { Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DAY_OF_YEAR, day); return formatDate(calendar.getTime(), "yyyy-MM-dd") + " 00:00:00"; }/*from w ww .j a v a 2s . c o m*/ /** * * @Author :wdcai * @Comment : * @param date * @param format * @return */ public static String formatDate(Date date, String format) { if (date == null) return ""; SimpleDateFormat dateformat = new SimpleDateFormat(format); return dateformat.format(date); } }