Java Date Add add(long date, int field, int amount)

Here you can find the source of add(long date, int field, int amount)

Description

add

License

Apache License

Declaration

public static long add(long date, int field, int amount) 

Method Source Code

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

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

public class Main {
    public static long add(long date, int field, int amount) {
        Calendar cal = GregorianCalendar.getInstance();
        cal.setTime(new Date(date));
        cal.add(field, amount);/*from w w w.  j a v a2 s. c om*/
        return cal.getTime().getTime();
    }
}

Related

  1. add(Date date, long minutes)
  2. add(Date eredeti, int mihez, int mennyit)
  3. add(Date when, int amount, int field)
  4. add(int datePart, int detal, Date date)
  5. add(int field, int value, Date fromDate)
  6. add30Minutes(Date date)
  7. addCertainTime(java.util.Date date, double hours)
  8. addDate(Date date, int add)
  9. addDate(Date date, int amount, int type)