Java Date Calculate calculate(Date d, int field, int amount)

Here you can find the source of calculate(Date d, int field, int amount)

Description

calculate

License

Apache License

Declaration

private static Date calculate(Date d, int field, int amount) 

Method Source Code

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

import java.util.*;

public class Main {

    private static Date calculate(Date d, int field, int amount) {
        if (d == null)
            return null;
        GregorianCalendar g = new GregorianCalendar();
        g.setGregorianChange(d);//from  w ww  .ja v  a  2 s .  com
        g.add(field, amount);
        return g.getTime();
    }
}

Related

  1. before(final Date date, final long compareTime)
  2. calculaDataTermino(Date dataInicio, int prazo)
  3. calculaIdadeEmAnos(Date dDataNasc, Date dataRef)
  4. calculaIdadeEmMeses(Date dDataNasc)
  5. calculaIdadeMesAno(Date dDataNasc, String type)
  6. calculateByDate(Date d, int amount)
  7. calculateDate(Date date, int field, int value)
  8. calculateDays(Date startDate, Date endDate)
  9. calculateDurationEndInSec(Date start, int durationInSeconds)