Java Day of getInsertDayDate(int days)

Here you can find the source of getInsertDayDate(int days)

Description

get Insert Day Date

License

Open Source License

Declaration

public static String getInsertDayDate(int days) 

Method Source Code

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

Related

  1. getFirstOfDay(Date date)
  2. getFirstTimeInDay(Date day)
  3. getFormattedNowDatePlusDays(int days, String dateFormat)
  4. getFullAge(Date birthday)
  5. getIncrementDaysSecond(String strDate, int sec)
  6. getIntervalDate(String date, int intervalDays)
  7. getIntervalDays(Date fDate, Date oDate)
  8. getIntevalDays(String startDate, String endDate)
  9. getLateInTheDay(Date date)