Here you can find the source of getNextMonth(Date baseDate, int Month)
Description:Get the date after the base date passed in as first parameter and interval is specified by second parameter
Parameter | Description |
---|---|
Date | baseDate |
public static Date getNextMonth(Date baseDate, int Month)
//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; } }