Java Day From getNextDay(Date startTime, int n)

Here you can find the source of getNextDay(Date startTime, int n)

Description

get Next Day

License

Open Source License

Declaration

public static Date getNextDay(Date startTime, int n) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {

    public static Date getNextDay(Date startTime, int n) {
        Calendar calendar = new GregorianCalendar();
        calendar.setTime(startTime);//from ww  w  . j ava 2s. c  om
        calendar.add(Calendar.DATE, n);
        return calendar.getTime();
    }

    public static Date add(Date when, int field, int amount) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(when);
        calendar.add(field, amount);
        return calendar.getTime();
    }
}

Related

  1. getDaysBetween(int dateInt1, int dateInt2)
  2. getDaysInPastForDate(Date date)
  3. getFirstMilliOfDay(Date date)
  4. getIntervalInDaysSofar(Date from)
  5. getLastDay(Date date)
  6. getNextDay(String date)
  7. getNoonOfDay(Date day)
  8. getPlusDay(String _oneDay, int _aFewDays)
  9. getServerOffset(boolean useDaylightSavingTime)