Java Date Calculate before(Date dt, Date dt2)

Here you can find the source of before(Date dt, Date dt2)

Description

Date one comes before date two.

License

Apache License

Parameter

Parameter Description
dt date one
dt2 date two

Return

true if neither are null and the first is before the second

Declaration

public static boolean before(Date dt, Date dt2) 

Method Source Code

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

import java.util.*;

public class Main {
    /**//from www . j  ava2 s  .  c  o  m
     * Date one comes before date two.
     *
     * @param dt  date one
     * @param dt2 date two
     * @return true if neither are null and the first is before the second
     */
    public static boolean before(Date dt, Date dt2) {
        return !(dt == null || dt2 == null) && dt.before(dt2);

    }
}

Related

  1. adjust(Date date, int h, int m, int s)
  2. after(Date dt, Date dt2)
  3. before(final Date date, final long compareTime)
  4. calculaDataTermino(Date dataInicio, int prazo)
  5. calculaIdadeEmAnos(Date dDataNasc, Date dataRef)
  6. calculaIdadeEmMeses(Date dDataNasc)