Java Calendar Add add(Calendar calendar, int calendarField, int amount)

Here you can find the source of add(Calendar calendar, int calendarField, int amount)

Description

add

License

Apache License

Declaration

static public Calendar add(Calendar calendar, int calendarField, int amount) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;

public class Main {
    static public Calendar add(Calendar calendar, int calendarField, int amount) {
        Calendar c = Calendar.getInstance();
        c.setTime(calendar.getTime());// w ww  .  j  a  va2s  .  c o m
        c.add(calendarField, amount);
        return c;
    }
}

Related

  1. add(Date _date, int _calendarField, int _amount)
  2. add(Date date, int calendarField, int amount)
  3. add(Date inputDate, int interval, int calendarUnit)
  4. add(final Date date, final int calendarField, final int amount)