Java Date Before getDayBeforeOrAfter2(Date time, int days)

Here you can find the source of getDayBeforeOrAfter2(Date time, int days)

Description

get Day Before Or After

License

Open Source License

Declaration

public static Date getDayBeforeOrAfter2(Date time, int days) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;
import java.util.Date;

public class Main {

    public static Date getDayBeforeOrAfter2(Date time, int days) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(time);// w w  w.  j a  va  2  s  .c  o m
        calendar.add(Calendar.DAY_OF_MONTH, days);
        return calendar.getTime();
    }
}

Related

  1. getDateBeforeSomeMinutes(int minute, long timestamp)
  2. getDateBeforeTheDay(String day, int num)
  3. getDateBeforeToday(int num)
  4. getDateBeforTwelveMonth()
  5. getDateTimeAfterOfBeforeHour(Integer AfterOfBeforeHour)
  6. getDayFormSomeDay(Date date, int n, boolean before)
  7. getDistanceMonthOfTwoDate(Date before, Date after)
  8. getMinuteBefore(Date date, int minute)
  9. getMonth(Date time, int monthBefore, int monthAfter)