Here you can find the source of getCalendarDateFromToday(final int numDays)
Parameter | Description |
---|---|
numDays | Number of days to flip through in the calendar. |
public static long getCalendarDateFromToday(final int numDays)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { /**/*from www. j a v a 2 s . com*/ * Flips through the Calendar from the current date * over the given number of days to fetch the required date * in milli seconds. * @param numDays * Number of days to flip through in the calendar. * @return timeInMillis * Date stamp in milli seconds after flipping through * the calendar. */ public static long getCalendarDateFromToday(final int numDays) { Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); cal.add(Calendar.DAY_OF_MONTH, numDays); return cal.getTimeInMillis(); } }