Java Date Calculate calculateDate(Date date, int field, int value)

Here you can find the source of calculateDate(Date date, int field, int value)

Description

calculate Date

License

Apache License

Declaration

public static Date calculateDate(Date date, int field, int value) 

Method Source Code

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

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

public class Main {
    public static Date calculateDate(Date date, int field, int value) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);/*from w w  w  .  j  a  v  a  2s. c  o m*/
        c.add(field, value);
        return c.getTime();
    }
}

Related

  1. calculaIdadeEmAnos(Date dDataNasc, Date dataRef)
  2. calculaIdadeEmMeses(Date dDataNasc)
  3. calculaIdadeMesAno(Date dDataNasc, String type)
  4. calculate(Date d, int field, int amount)
  5. calculateByDate(Date d, int amount)
  6. calculateDays(Date startDate, Date endDate)
  7. calculateDurationEndInSec(Date start, int durationInSeconds)
  8. calculateEndDate(Date startDate, int duration)
  9. calculateGestationAge(Date today, Date edd)