Android Day Add addDayOfMonth(Date date)

Here you can find the source of addDayOfMonth(Date date)

Description

add Day Of Month

License

Open Source License

Declaration

public static Date addDayOfMonth(Date date) 

Method Source Code

//package com.java2s;

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Date addDayOfMonth(Date date) {
        Calendar calendar = calendarDate(date);
        calendar.add(Calendar.DAY_OF_MONTH, 1);
        return calendar.getTime();
    }//  w  w  w. j a  v  a 2s  .c o  m

    public static Date addDayOfMonth(Date date, int difference) {
        Calendar calendar = calendarDate(date);
        calendar.add(Calendar.DAY_OF_MONTH, difference);
        return calendar.getTime();
    }

    public static Calendar calendarDate(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        return calendar;
    }
}

Related

  1. addDayOfMonth(Date date, int difference)
  2. addDay(long dateTimeMillis)
  3. addDay(long dateTimeMillis)
  4. decrementOneDay(Time t)