Java Day of getBeforeOrAfterDay(Date date, String format, Integer days)

Here you can find the source of getBeforeOrAfterDay(Date date, String format, Integer days)

Description

get Before Or After Day

License

Apache License

Declaration

public static String getBeforeOrAfterDay(Date date, String format, Integer days) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {

    public static String getBeforeOrAfterDay(Date date, String format, Integer days) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);//from w  w w  .j a  va  2  s  .  co  m
        calendar.add(Calendar.DAY_OF_MONTH, days);
        SimpleDateFormat df = new SimpleDateFormat(format);
        return df.format(calendar.getTime());
    }
}

Related

  1. getAfterDays(String date, String pattern, int afterDays)
  2. getAge(Date birthDay)
  3. getAgeOfCalendar(String birthDayString)
  4. getApisPaxBirthday(String dob)
  5. getBeforeDate(int day)
  6. getBeginEndTimeOfDay(Date day)
  7. getBeginOfDay(Date date)
  8. getBeginTimeOfDay(Date date, int offset)
  9. getBirthday(String age)