Java Date to Month getNextMonth(Date baseDate, int Month)

Here you can find the source of getNextMonth(Date baseDate, int Month)

Description

Description:Get the date after the base date passed in as first parameter and interval is specified by second parameter

License

Open Source License

Parameter

Parameter Description
Date baseDate

Return

Date

Declaration

public static Date getNextMonth(Date baseDate, int Month) 

Method Source Code

//package com.java2s;
/*//from   ww w . j  a v  a 2  s .  c  o  m
 * $RCSfile: DatetimeUtil,v $$
 * $Revision: 1.0  $
 * $Date: 2011  $
 *
 * Copyright (C) 2011 GyTech, Inc. All rights reserved.
 *
 * This software is the proprietary information of GyTech, Inc.
 * Use is subject to license terms.
 */

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

public class Main {
    /**
     * <p>Description:Get the date after the base date passed in as first parameter and interval is
     *                         specified by second parameter
     * </p>
     * @param Date baseDate 
     * @param int days
     * @return Date 
     */
    public static Date getNextMonth(Date baseDate, int Month) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(baseDate);
        calendar.add(Calendar.MONTH, Month);
        Date resultDate = calendar.getTime();

        return resultDate;
    }
}

Related

  1. getMonthRate(Date date, boolean moveIn)
  2. getMonths(Date date1, Date date2)
  3. getMonthStart(Date date)
  4. getMonthStart(Date date)
  5. getMonthStartDay(Date date)
  6. getNextMonth(Date time)
  7. getNextMonth(long date)
  8. getNextMonthDate(Date appointDate)
  9. getNextMonthExtention(Date dt, Long n)