Here you can find the source of getNextMonth(Calendar calendar, int month)
Parameter | Description |
---|---|
calendar | ex:2007/01/01 |
month | number of next month ex:5 |
public static Calendar getNextMonth(Calendar calendar, int month)
//package com.java2s; /*// w ww .j a v a 2 s . c o m * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.util.Calendar; public class Main { /** * @param calendar ex:2007/01/01 * @param month number of next month ex:5 * @return Calendar ex:2007/05/01 * @example Calendar nextDate = DateUtils.getNextMonth( * DateUtils.getCurrentDateCalendarEng(), 5 ); */ public static Calendar getNextMonth(Calendar calendar, int month) { calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) + month); return calendar; } }