Here you can find the source of getNextDay(Calendar calendar, int day)
Parameter | Description |
---|---|
calendar | ex:2007/01/01 |
day | number of next ex:5 |
public static Calendar getNextDay(Calendar calendar, int day)
//package com.java2s; /*//w w w . j a va2s .com * 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 day number of next ex:5 * @return Calendar ex:2007/01/06 * @example Calendar nextDate = DateUtils.getNextDay( * DateUtils.getCurrentDateCalendarEng(), 5 ); */ public static Calendar getNextDay(Calendar calendar, int day) { Calendar nextDay = (Calendar) calendar.clone(); nextDay.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + day); return nextDay; } }