Java Month Next nextMonth(Date d)

Here you can find the source of nextMonth(Date d)

Description

next Month

License

Open Source License

Declaration

public static Date nextMonth(Date d) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static Date nextMonth(Date d) {
        return addMonth(d, 1);
    }/*from  w  ww.java 2 s  .  c o  m*/

    public static Date addMonth(Date d, int mth) {
        if (d == null)
            return d;
        Calendar cal = Calendar.getInstance();
        cal.clear();
        cal.setTime(d);
        cal.add(Calendar.MONTH, mth);

        return cal.getTime();
    }
}

Related

  1. nextMonth(Date date)
  2. nextMonth(Date date, int month)
  3. nextMonth(Date then)
  4. nextMonth(final Date date)