Java Calendar Different getDiffTargetDate(Calendar cal, int diffDay)

Here you can find the source of getDiffTargetDate(Calendar cal, int diffDay)

Description

get Diff Target Date

License

Open Source License

Declaration

public static Date getDiffTargetDate(Calendar cal, int diffDay) 

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 getDiffTargetDate(Calendar cal, int diffDay) {
        if (null == cal) {
            cal = Calendar.getInstance();
        }//from  www .j a v a  2 s .co  m
        //      cal.set(cal.DAY_OF_YEAR, cal.get(cal.DAY_OF_YEAR)+diffDay);
        cal.add(Calendar.DATE, diffDay);
        return cal.getTime();
    }
}

Related

  1. getDifference(int constant, Calendar first, Calendar second)
  2. getDifference(int field, Calendar aCalX, Calendar aCalY)
  3. getDifferenceInDays(Calendar fromDate, Calendar toDate)
  4. getDifferenceInSeconds(Calendar calendarStart, Calendar calendarEnd)
  5. getDiffPartialYears(Date date, GregorianCalendar b)
  6. getMillisDiff(long lhs, long rhs, int gregorianCalendarUnits)
  7. getMonthDiff(Calendar c1, Calendar c2)
  8. getMonthsDifference(Calendar date1, Calendar date2)
  9. getTargetDate(Calendar reqCal, int diffMon, int proxyDay)