Java Date Add add(int field, int value, Date fromDate)

Here you can find the source of add(int field, int value, Date fromDate)

Description

add

License

Open Source License

Declaration

private static Date add(int field, int value, Date fromDate) 

Method Source Code


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

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

public class Main {
    private static Date add(int field, int value, Date fromDate) {
        fromDate = (fromDate == null) ? new Date() : fromDate;
        Calendar cal = Calendar.getInstance();
        cal.setTime(fromDate);// ww  w  . j  a  v  a  2  s  .  c  o m
        cal.add(field, value);

        return cal.getTime();
    }
}

Related

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