Java Day Between getDateDiff(Date date, int day)

Here you can find the source of getDateDiff(Date date, int day)

Description

get Date Diff

License

Apache License

Declaration

public static Date getDateDiff(Date date, int day) 

Method Source Code

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

import java.util.Calendar;

import java.util.Date;

public class Main {
    public final static Calendar cal = Calendar.getInstance();

    public static Date getDateDiff(Date date, int day) {
        cal.setTime(date);//from  w w w  . j  av a  2  s.  co m
        cal.add(Calendar.DAY_OF_MONTH, day);
        Date tmpdate = new Date(cal.getTime().getTime());
        return tmpdate;
    }
}

Related

  1. diffInDays(Date date1, Date date2)
  2. getBeteenDays(String begin, String end, String format)
  3. getBetweenDays(long longValue1, long longValue2)
  4. getBetweenDays(String start, String end)
  5. getBetweenTwoDayCalender(String startDay, String endDay)
  6. getDateDiff(final Date startDate, final Date endDate)
  7. getDateDifference(Date date1, Date date2)
  8. getDateDifferenceinDays(Date date1, Date date2)
  9. getDateDiffYear(Date date, int diff, String... format)