Java Calendar Different getTargetDate(Calendar reqCal, int diffMon, int proxyDay)

Here you can find the source of getTargetDate(Calendar reqCal, int diffMon, int proxyDay)

Description

get Target Date

License

Open Source License

Declaration

public static Date getTargetDate(Calendar reqCal, int diffMon, int proxyDay) 

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 getTargetDate(Calendar reqCal, int diffMon, int proxyDay) {
        Calendar cal = null == reqCal ? Calendar.getInstance() : reqCal;
        cal.set(Calendar.MONTH, cal.get(Calendar.MONTH) + diffMon);
        cal.set(Calendar.DATE, proxyDay);
        Date date = cal.getTime();
        return date;
    }//w  w  w .  j  av a2 s .  c  o m
}

Related

  1. getDiffPartialYears(Date date, GregorianCalendar b)
  2. getDiffTargetDate(Calendar cal, int diffDay)
  3. getMillisDiff(long lhs, long rhs, int gregorianCalendarUnits)
  4. getMonthDiff(Calendar c1, Calendar c2)
  5. getMonthsDifference(Calendar date1, Calendar date2)
  6. getTimeDifference(String unit, Calendar start, Calendar end)
  7. getTimeDiffSecond(Calendar first, Calendar second)
  8. getWeekDifference(Calendar before, Calendar after)
  9. getYearDifference(GregorianCalendar fromCalendar, GregorianCalendar toCalendar)