Java Day getDaysLater(int day)

Here you can find the source of getDaysLater(int day)

Description

get Days Later

License

Open Source License

Declaration

public static String getDaysLater(int day) 

Method Source Code

//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);
    }
}

Related

  1. getDaysAgo(int interval)
  2. getDaysByYearMonth(String ym)
  3. getDaysForDate(String date)
  4. getDaysforYear()
  5. getDaysFrom2Dates(Calendar calendar1, Calendar calendar2)
  6. getDaysMonthYear(Date date)
  7. getDaysOfDates(Date first, Date second)
  8. getdaysslice(String startdate, String enddate)
  9. getDayStr(int i, String formatStr)