Java Month Calculate nextMonth(Date date, int months)

Here you can find the source of nextMonth(Date date, int months)

Description

next Month

License

Apache License

Declaration

public static Date nextMonth(Date date, int months) 

Method Source Code

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

import java.util.*;

public class Main {

    public static Date nextMonth(Date date, int months) {
        Calendar cal = Calendar.getInstance();
        if (date != null) {
            cal.setTime(date);//from   ww  w  .j  a  va  2 s  .  c  o  m
        }
        cal.add(Calendar.MONTH, months);
        return cal.getTime();
    }
}

Related

  1. intToCalendarMonth(int month)
  2. isFirstOfMonth(long date)
  3. isMonthEnd(Date date)
  4. isSameMonth(final Calendar c1, final Calendar c2)
  5. monthsBetween(String pFormerStr, String pLatterStr)
  6. nextMonths(int diff)
  7. startOfMonth(Date d)
  8. startOfMonth(Date date)
  9. startOfMonthDate(Date date)